/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'cn-qingdao' = 'apigateway.cn-qingdao.aliyuncs.com',
    'cn-beijing' = 'apigateway.cn-beijing.aliyuncs.com',
    'cn-zhangjiakou' = 'apigateway.cn-zhangjiakou.aliyuncs.com',
    'cn-huhehaote' = 'apigateway.cn-huhehaote.aliyuncs.com',
    'cn-wulanchabu' = 'apigateway.cn-wulanchabu.aliyuncs.com',
    'cn-hangzhou' = 'apigateway.cn-hangzhou.aliyuncs.com',
    'cn-shanghai' = 'apigateway.cn-shanghai.aliyuncs.com',
    'cn-shenzhen' = 'apigateway.cn-shenzhen.aliyuncs.com',
    'cn-heyuan' = 'apigateway.cn-heyuan.aliyuncs.com',
    'cn-guangzhou' = 'apigateway.cn-guangzhou.aliyuncs.com',
    'cn-chengdu' = 'apigateway.cn-chengdu.aliyuncs.com',
    'cn-hongkong' = 'apigateway.cn-hongkong.aliyuncs.com',
    'ap-northeast-1' = 'apigateway.ap-northeast-1.aliyuncs.com',
    'ap-southeast-1' = 'apigateway.ap-southeast-1.aliyuncs.com',
    'ap-southeast-2' = 'apigateway.ap-southeast-2.aliyuncs.com',
    'ap-southeast-3' = 'apigateway.ap-southeast-3.aliyuncs.com',
    'ap-southeast-5' = 'apigateway.ap-southeast-5.aliyuncs.com',
    'ap-southeast-6' = 'apigateway.ap-southeast-6.aliyuncs.com',
    'ap-southeast-7' = 'apigateway.ap-southeast-7.aliyuncs.com',
    'us-east-1' = 'apigateway.us-east-1.aliyuncs.com',
    'us-west-1' = 'apigateway.us-west-1.aliyuncs.com',
    'eu-west-1' = 'apigateway.eu-west-1.aliyuncs.com',
    'eu-central-1' = 'apigateway.eu-central-1.aliyuncs.com',
    'ap-south-1' = 'apigateway.ap-south-1.aliyuncs.com',
    'me-east-1' = 'apigateway.me-east-1.aliyuncs.com',
    'me-central-1' = 'apigateway.me-central-1.aliyuncs.com',
    'cn-hangzhou-finance' = 'apigateway.cn-hangzhou-finance.aliyuncs.com',
    'cn-shanghai-finance-1' = 'apigateway.cn-shanghai-finance-1.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'apigateway.cn-shenzhen-finance-1.aliyuncs.com',
    'cn-north-2-gov-1' = 'apigateway.cn-north-2-gov-1.aliyuncs.com',
    'ap-northeast-2-pop' = 'apigateway.aliyuncs.com',
    'cn-beijing-finance-1' = 'apigateway.cn-beijing-finance-1.aliyuncs.com',
    'cn-beijing-finance-pop' = 'apigateway.aliyuncs.com',
    'cn-beijing-gov-1' = 'apigateway.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'apigateway.aliyuncs.com',
    'cn-edge-1' = 'apigateway.aliyuncs.com',
    'cn-fujian' = 'apigateway.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'apigateway.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'apigateway.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'apigateway.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'apigateway.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'apigateway.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'apigateway.aliyuncs.com',
    'cn-hangzhou-test-306' = 'apigateway.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'apigateway.aliyuncs.com',
    'cn-huhehaote-nebula-1' = 'apigateway.aliyuncs.com',
    'cn-qingdao-nebula' = 'apigateway.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'apigateway.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'apigateway.aliyuncs.com',
    'cn-shanghai-inner' = 'apigateway.cn-shanghai-inner.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'apigateway.aliyuncs.com',
    'cn-shenzhen-inner' = 'apigateway.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'apigateway.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'apigateway.aliyuncs.com',
    'cn-wuhan' = 'apigateway.aliyuncs.com',
    'cn-yushanfang' = 'apigateway.aliyuncs.com',
    'cn-zhangbei' = 'apigateway.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'apigateway.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'apigateway.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'apigateway.aliyuncs.com',
    'eu-west-1-oxs' = 'apigateway.aliyuncs.com',
    'rus-west-1-pop' = 'apigateway.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('cloudapi', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AbolishApiRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model AbolishApiResponseBody = {
  requestId?: string(name='RequestId'),
}

model AbolishApiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AbolishApiResponseBody(name='body'),
}

async function abolishApiWithOptions(request: AbolishApiRequest, runtime: Util.RuntimeOptions): AbolishApiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AbolishApi',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function abolishApi(request: AbolishApiRequest): AbolishApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return abolishApiWithOptions(request, runtime);
}

model AddBlackListRequest {
  blackContent?: string(name='BlackContent'),
  blackType?: string(name='BlackType'),
  description?: string(name='Description'),
  securityToken?: string(name='SecurityToken'),
}

model AddBlackListResponseBody = {
  requestId?: string(name='RequestId'),
}

model AddBlackListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddBlackListResponseBody(name='body'),
}

async function addBlackListWithOptions(request: AddBlackListRequest, runtime: Util.RuntimeOptions): AddBlackListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.blackContent)) {
    query['BlackContent'] = request.blackContent;
  }
  if (!Util.isUnset(request.blackType)) {
    query['BlackType'] = request.blackType;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddBlackList',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addBlackList(request: AddBlackListRequest): AddBlackListResponse {
  var runtime = new Util.RuntimeOptions{};
  return addBlackListWithOptions(request, runtime);
}

model AddIpControlPolicyItemRequest {
  appId?: string(name='AppId'),
  cidrIp?: string(name='CidrIp'),
  ipControlId?: string(name='IpControlId'),
  securityToken?: string(name='SecurityToken'),
}

model AddIpControlPolicyItemResponseBody = {
  policyItemId?: string(name='PolicyItemId'),
  requestId?: string(name='RequestId'),
}

model AddIpControlPolicyItemResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddIpControlPolicyItemResponseBody(name='body'),
}

async function addIpControlPolicyItemWithOptions(request: AddIpControlPolicyItemRequest, runtime: Util.RuntimeOptions): AddIpControlPolicyItemResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.cidrIp)) {
    query['CidrIp'] = request.cidrIp;
  }
  if (!Util.isUnset(request.ipControlId)) {
    query['IpControlId'] = request.ipControlId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddIpControlPolicyItem',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addIpControlPolicyItem(request: AddIpControlPolicyItemRequest): AddIpControlPolicyItemResponse {
  var runtime = new Util.RuntimeOptions{};
  return addIpControlPolicyItemWithOptions(request, runtime);
}

model AddTrafficSpecialControlRequest {
  securityToken?: string(name='SecurityToken'),
  specialKey?: string(name='SpecialKey'),
  specialType?: string(name='SpecialType'),
  trafficControlId?: string(name='TrafficControlId'),
  trafficValue?: int32(name='TrafficValue'),
}

model AddTrafficSpecialControlResponseBody = {
  requestId?: string(name='RequestId'),
}

model AddTrafficSpecialControlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddTrafficSpecialControlResponseBody(name='body'),
}

async function addTrafficSpecialControlWithOptions(request: AddTrafficSpecialControlRequest, runtime: Util.RuntimeOptions): AddTrafficSpecialControlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.specialKey)) {
    query['SpecialKey'] = request.specialKey;
  }
  if (!Util.isUnset(request.specialType)) {
    query['SpecialType'] = request.specialType;
  }
  if (!Util.isUnset(request.trafficControlId)) {
    query['TrafficControlId'] = request.trafficControlId;
  }
  if (!Util.isUnset(request.trafficValue)) {
    query['TrafficValue'] = request.trafficValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddTrafficSpecialControl',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addTrafficSpecialControl(request: AddTrafficSpecialControlRequest): AddTrafficSpecialControlResponse {
  var runtime = new Util.RuntimeOptions{};
  return addTrafficSpecialControlWithOptions(request, runtime);
}

model CreateApiRequest {
  allowSignatureMethod?: string(name='AllowSignatureMethod'),
  apiName?: string(name='ApiName'),
  appCodeAuthType?: string(name='AppCodeAuthType'),
  authType?: string(name='AuthType'),
  description?: string(name='Description'),
  disableInternet?: boolean(name='DisableInternet'),
  errorCodeSamples?: string(name='ErrorCodeSamples'),
  failResultSample?: string(name='FailResultSample'),
  forceNonceCheck?: boolean(name='ForceNonceCheck'),
  groupId?: string(name='GroupId'),
  openIdConnectConfig?: string(name='OpenIdConnectConfig'),
  requestConfig?: string(name='RequestConfig'),
  requestParamters?: string(name='RequestParamters'),
  resultBodyModel?: string(name='ResultBodyModel'),
  resultDescriptions?: string(name='ResultDescriptions'),
  resultSample?: string(name='ResultSample'),
  resultType?: string(name='ResultType'),
  securityToken?: string(name='SecurityToken'),
  serviceConfig?: string(name='ServiceConfig'),
  serviceParameters?: string(name='ServiceParameters'),
  serviceParametersMap?: string(name='ServiceParametersMap'),
  visibility?: string(name='Visibility'),
  webSocketApiType?: string(name='WebSocketApiType'),
}

model CreateApiResponseBody = {
  apiId?: string(name='ApiId'),
  requestId?: string(name='RequestId'),
}

model CreateApiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateApiResponseBody(name='body'),
}

async function createApiWithOptions(request: CreateApiRequest, runtime: Util.RuntimeOptions): CreateApiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.allowSignatureMethod)) {
    query['AllowSignatureMethod'] = request.allowSignatureMethod;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.appCodeAuthType)) {
    query['AppCodeAuthType'] = request.appCodeAuthType;
  }
  if (!Util.isUnset(request.authType)) {
    query['AuthType'] = request.authType;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.disableInternet)) {
    query['DisableInternet'] = request.disableInternet;
  }
  if (!Util.isUnset(request.errorCodeSamples)) {
    query['ErrorCodeSamples'] = request.errorCodeSamples;
  }
  if (!Util.isUnset(request.failResultSample)) {
    query['FailResultSample'] = request.failResultSample;
  }
  if (!Util.isUnset(request.forceNonceCheck)) {
    query['ForceNonceCheck'] = request.forceNonceCheck;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.openIdConnectConfig)) {
    query['OpenIdConnectConfig'] = request.openIdConnectConfig;
  }
  if (!Util.isUnset(request.requestConfig)) {
    query['RequestConfig'] = request.requestConfig;
  }
  if (!Util.isUnset(request.requestParamters)) {
    query['RequestParamters'] = request.requestParamters;
  }
  if (!Util.isUnset(request.resultBodyModel)) {
    query['ResultBodyModel'] = request.resultBodyModel;
  }
  if (!Util.isUnset(request.resultDescriptions)) {
    query['ResultDescriptions'] = request.resultDescriptions;
  }
  if (!Util.isUnset(request.resultSample)) {
    query['ResultSample'] = request.resultSample;
  }
  if (!Util.isUnset(request.resultType)) {
    query['ResultType'] = request.resultType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serviceConfig)) {
    query['ServiceConfig'] = request.serviceConfig;
  }
  if (!Util.isUnset(request.serviceParameters)) {
    query['ServiceParameters'] = request.serviceParameters;
  }
  if (!Util.isUnset(request.serviceParametersMap)) {
    query['ServiceParametersMap'] = request.serviceParametersMap;
  }
  if (!Util.isUnset(request.visibility)) {
    query['Visibility'] = request.visibility;
  }
  if (!Util.isUnset(request.webSocketApiType)) {
    query['WebSocketApiType'] = request.webSocketApiType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApi',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createApi(request: CreateApiRequest): CreateApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApiWithOptions(request, runtime);
}

model CreateApiGroupRequest {
  description?: string(name='Description'),
  groupName?: string(name='GroupName'),
  instanceId?: string(name='InstanceId'),
  securityToken?: string(name='SecurityToken'),
}

model CreateApiGroupResponseBody = {
  description?: string(name='Description'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  instanceId?: string(name='InstanceId'),
  instanceType?: string(name='InstanceType'),
  requestId?: string(name='RequestId'),
  subDomain?: string(name='SubDomain'),
}

model CreateApiGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateApiGroupResponseBody(name='body'),
}

async function createApiGroupWithOptions(request: CreateApiGroupRequest, runtime: Util.RuntimeOptions): CreateApiGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApiGroup',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createApiGroup(request: CreateApiGroupRequest): CreateApiGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApiGroupWithOptions(request, runtime);
}

model CreateApiStageVariableRequest {
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageId?: string(name='StageId'),
  stageRouteModel?: string(name='StageRouteModel'),
  supportRoute?: boolean(name='SupportRoute'),
  variableName?: string(name='VariableName'),
  variableValue?: string(name='VariableValue'),
}

model CreateApiStageVariableResponseBody = {
  requestId?: string(name='RequestId'),
}

model CreateApiStageVariableResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateApiStageVariableResponseBody(name='body'),
}

async function createApiStageVariableWithOptions(request: CreateApiStageVariableRequest, runtime: Util.RuntimeOptions): CreateApiStageVariableResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageId)) {
    query['StageId'] = request.stageId;
  }
  if (!Util.isUnset(request.stageRouteModel)) {
    query['StageRouteModel'] = request.stageRouteModel;
  }
  if (!Util.isUnset(request.supportRoute)) {
    query['SupportRoute'] = request.supportRoute;
  }
  if (!Util.isUnset(request.variableName)) {
    query['VariableName'] = request.variableName;
  }
  if (!Util.isUnset(request.variableValue)) {
    query['VariableValue'] = request.variableValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApiStageVariable',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createApiStageVariable(request: CreateApiStageVariableRequest): CreateApiStageVariableResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApiStageVariableWithOptions(request, runtime);
}

model CreateAppRequest {
  appName?: string(name='AppName'),
  description?: string(name='Description'),
  securityToken?: string(name='SecurityToken'),
}

model CreateAppResponseBody = {
  appId?: long(name='AppId'),
  requestId?: string(name='RequestId'),
}

model CreateAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppResponseBody(name='body'),
}

async function createAppWithOptions(request: CreateAppRequest, runtime: Util.RuntimeOptions): CreateAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApp',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createApp(request: CreateAppRequest): CreateAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppWithOptions(request, runtime);
}

model CreateCustomizedInfoRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  csharpDemo?: string(name='CsharpDemo'),
  curlDemo?: string(name='CurlDemo'),
  groupId?: string(name='GroupId'),
  javaDemo?: string(name='JavaDemo'),
  objectcDemo?: string(name='ObjectcDemo'),
  phpDemo?: string(name='PhpDemo'),
  pythonDemo?: string(name='PythonDemo'),
  securityToken?: string(name='SecurityToken'),
  stageId?: string(name='StageId'),
  stageName?: string(name='StageName'),
}

model CreateCustomizedInfoResponseBody = {
  requestId?: string(name='RequestId'),
}

model CreateCustomizedInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateCustomizedInfoResponseBody(name='body'),
}

async function createCustomizedInfoWithOptions(request: CreateCustomizedInfoRequest, runtime: Util.RuntimeOptions): CreateCustomizedInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.csharpDemo)) {
    query['CsharpDemo'] = request.csharpDemo;
  }
  if (!Util.isUnset(request.curlDemo)) {
    query['CurlDemo'] = request.curlDemo;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.javaDemo)) {
    query['JavaDemo'] = request.javaDemo;
  }
  if (!Util.isUnset(request.objectcDemo)) {
    query['ObjectcDemo'] = request.objectcDemo;
  }
  if (!Util.isUnset(request.phpDemo)) {
    query['PhpDemo'] = request.phpDemo;
  }
  if (!Util.isUnset(request.pythonDemo)) {
    query['PythonDemo'] = request.pythonDemo;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageId)) {
    query['StageId'] = request.stageId;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCustomizedInfo',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createCustomizedInfo(request: CreateCustomizedInfoRequest): CreateCustomizedInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCustomizedInfoWithOptions(request, runtime);
}

model CreateInstanceRequest {
  accountQuantity?: int32(name='AccountQuantity'),
  expiredOn?: string(name='ExpiredOn'),
  securityToken?: string(name='SecurityToken'),
  skuId?: string(name='SkuId'),
  token?: string(name='Token'),
}

model CreateInstanceResponseBody = {
  instanceId?: string(name='InstanceId'),
  requestId?: string(name='RequestId'),
}

model CreateInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateInstanceResponseBody(name='body'),
}

async function createInstanceWithOptions(request: CreateInstanceRequest, runtime: Util.RuntimeOptions): CreateInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountQuantity)) {
    query['AccountQuantity'] = request.accountQuantity;
  }
  if (!Util.isUnset(request.expiredOn)) {
    query['ExpiredOn'] = request.expiredOn;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.skuId)) {
    query['SkuId'] = request.skuId;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateInstance',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createInstance(request: CreateInstanceRequest): CreateInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createInstanceWithOptions(request, runtime);
}

model CreateIntranetDomainRequest {
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model CreateIntranetDomainResponseBody = {
  domainName?: string(name='DomainName'),
  requestId?: string(name='RequestId'),
}

model CreateIntranetDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateIntranetDomainResponseBody(name='body'),
}

async function createIntranetDomainWithOptions(request: CreateIntranetDomainRequest, runtime: Util.RuntimeOptions): CreateIntranetDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIntranetDomain',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createIntranetDomain(request: CreateIntranetDomainRequest): CreateIntranetDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIntranetDomainWithOptions(request, runtime);
}

model CreateIpControlRequest {
  description?: string(name='Description'),
  ipControlName?: string(name='IpControlName'),
  ipControlPolicys?: [ 
    {
      appId?: string(name='AppId'),
      IP?: string(name='IP'),
    }
  ](name='IpControlPolicys'),
  ipControlType?: string(name='IpControlType'),
  securityToken?: string(name='SecurityToken'),
}

model CreateIpControlResponseBody = {
  ipControlId?: string(name='IpControlId'),
  requestId?: string(name='RequestId'),
}

model CreateIpControlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateIpControlResponseBody(name='body'),
}

async function createIpControlWithOptions(request: CreateIpControlRequest, runtime: Util.RuntimeOptions): CreateIpControlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.ipControlName)) {
    query['IpControlName'] = request.ipControlName;
  }
  if (!Util.isUnset(request.ipControlPolicys)) {
    query['IpControlPolicys'] = request.ipControlPolicys;
  }
  if (!Util.isUnset(request.ipControlType)) {
    query['IpControlType'] = request.ipControlType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIpControl',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createIpControl(request: CreateIpControlRequest): CreateIpControlResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIpControlWithOptions(request, runtime);
}

model CreateLogConfigRequest {
  logType?: string(name='LogType'),
  securityToken?: string(name='SecurityToken'),
  slsLogStore?: string(name='SlsLogStore'),
  slsProject?: string(name='SlsProject'),
}

model CreateLogConfigResponseBody = {
  requestId?: string(name='RequestId'),
}

model CreateLogConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateLogConfigResponseBody(name='body'),
}

async function createLogConfigWithOptions(request: CreateLogConfigRequest, runtime: Util.RuntimeOptions): CreateLogConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.logType)) {
    query['LogType'] = request.logType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.slsLogStore)) {
    query['SlsLogStore'] = request.slsLogStore;
  }
  if (!Util.isUnset(request.slsProject)) {
    query['SlsProject'] = request.slsProject;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateLogConfig',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createLogConfig(request: CreateLogConfigRequest): CreateLogConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return createLogConfigWithOptions(request, runtime);
}

model CreateRaceWorkForInnerRequest {
  commodityCode?: string(name='CommodityCode'),
  groupId?: string(name='GroupId'),
  keywords?: string(name='Keywords'),
  logoUrl?: string(name='LogoUrl'),
  securityToken?: string(name='SecurityToken'),
  shortDescription?: string(name='ShortDescription'),
  workName?: string(name='WorkName'),
}

model CreateRaceWorkForInnerResponseBody = {
  requestId?: string(name='RequestId'),
}

model CreateRaceWorkForInnerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateRaceWorkForInnerResponseBody(name='body'),
}

async function createRaceWorkForInnerWithOptions(request: CreateRaceWorkForInnerRequest, runtime: Util.RuntimeOptions): CreateRaceWorkForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.commodityCode)) {
    query['CommodityCode'] = request.commodityCode;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.keywords)) {
    query['Keywords'] = request.keywords;
  }
  if (!Util.isUnset(request.logoUrl)) {
    query['LogoUrl'] = request.logoUrl;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.shortDescription)) {
    query['ShortDescription'] = request.shortDescription;
  }
  if (!Util.isUnset(request.workName)) {
    query['WorkName'] = request.workName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateRaceWorkForInner',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createRaceWorkForInner(request: CreateRaceWorkForInnerRequest): CreateRaceWorkForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRaceWorkForInnerWithOptions(request, runtime);
}

model CreateSecretKeyRequest {
  secretKey?: string(name='SecretKey'),
  secretKeyName?: string(name='SecretKeyName'),
  secretValue?: string(name='SecretValue'),
  securityToken?: string(name='SecurityToken'),
}

model CreateSecretKeyResponseBody = {
  requestId?: string(name='RequestId'),
  secretKeyId?: string(name='SecretKeyId'),
  secretKeyName?: string(name='SecretKeyName'),
}

model CreateSecretKeyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSecretKeyResponseBody(name='body'),
}

async function createSecretKeyWithOptions(request: CreateSecretKeyRequest, runtime: Util.RuntimeOptions): CreateSecretKeyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.secretKey)) {
    query['SecretKey'] = request.secretKey;
  }
  if (!Util.isUnset(request.secretKeyName)) {
    query['SecretKeyName'] = request.secretKeyName;
  }
  if (!Util.isUnset(request.secretValue)) {
    query['SecretValue'] = request.secretValue;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSecretKey',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSecretKey(request: CreateSecretKeyRequest): CreateSecretKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSecretKeyWithOptions(request, runtime);
}

model CreateTrafficControlRequest {
  apiDefault?: int32(name='ApiDefault'),
  appDefault?: int32(name='AppDefault'),
  description?: string(name='Description'),
  securityToken?: string(name='SecurityToken'),
  trafficControlName?: string(name='TrafficControlName'),
  trafficControlUnit?: string(name='TrafficControlUnit'),
  userDefault?: int32(name='UserDefault'),
}

model CreateTrafficControlResponseBody = {
  requestId?: string(name='RequestId'),
  trafficControlId?: string(name='TrafficControlId'),
}

model CreateTrafficControlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateTrafficControlResponseBody(name='body'),
}

async function createTrafficControlWithOptions(request: CreateTrafficControlRequest, runtime: Util.RuntimeOptions): CreateTrafficControlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiDefault)) {
    query['ApiDefault'] = request.apiDefault;
  }
  if (!Util.isUnset(request.appDefault)) {
    query['AppDefault'] = request.appDefault;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.trafficControlName)) {
    query['TrafficControlName'] = request.trafficControlName;
  }
  if (!Util.isUnset(request.trafficControlUnit)) {
    query['TrafficControlUnit'] = request.trafficControlUnit;
  }
  if (!Util.isUnset(request.userDefault)) {
    query['UserDefault'] = request.userDefault;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateTrafficControl',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createTrafficControl(request: CreateTrafficControlRequest): CreateTrafficControlResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTrafficControlWithOptions(request, runtime);
}

model DeleteAllTrafficSpecialControlRequest {
  securityToken?: string(name='SecurityToken'),
  trafficControlId?: string(name='TrafficControlId'),
}

model DeleteAllTrafficSpecialControlResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteAllTrafficSpecialControlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAllTrafficSpecialControlResponseBody(name='body'),
}

async function deleteAllTrafficSpecialControlWithOptions(request: DeleteAllTrafficSpecialControlRequest, runtime: Util.RuntimeOptions): DeleteAllTrafficSpecialControlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.trafficControlId)) {
    query['TrafficControlId'] = request.trafficControlId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAllTrafficSpecialControl',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAllTrafficSpecialControl(request: DeleteAllTrafficSpecialControlRequest): DeleteAllTrafficSpecialControlResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAllTrafficSpecialControlWithOptions(request, runtime);
}

model DeleteApiRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteApiResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteApiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteApiResponseBody(name='body'),
}

async function deleteApiWithOptions(request: DeleteApiRequest, runtime: Util.RuntimeOptions): DeleteApiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApi',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteApi(request: DeleteApiRequest): DeleteApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteApiWithOptions(request, runtime);
}

model DeleteApiGroupRequest {
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteApiGroupResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteApiGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteApiGroupResponseBody(name='body'),
}

async function deleteApiGroupWithOptions(request: DeleteApiGroupRequest, runtime: Util.RuntimeOptions): DeleteApiGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApiGroup',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteApiGroup(request: DeleteApiGroupRequest): DeleteApiGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteApiGroupWithOptions(request, runtime);
}

model DeleteApiStageVariableRequest {
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageId?: string(name='StageId'),
  variableName?: string(name='VariableName'),
}

model DeleteApiStageVariableResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteApiStageVariableResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteApiStageVariableResponseBody(name='body'),
}

async function deleteApiStageVariableWithOptions(request: DeleteApiStageVariableRequest, runtime: Util.RuntimeOptions): DeleteApiStageVariableResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageId)) {
    query['StageId'] = request.stageId;
  }
  if (!Util.isUnset(request.variableName)) {
    query['VariableName'] = request.variableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApiStageVariable',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteApiStageVariable(request: DeleteApiStageVariableRequest): DeleteApiStageVariableResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteApiStageVariableWithOptions(request, runtime);
}

model DeleteAppRequest {
  appId?: long(name='AppId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteAppResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAppResponseBody(name='body'),
}

async function deleteAppWithOptions(request: DeleteAppRequest, runtime: Util.RuntimeOptions): DeleteAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApp',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteApp(request: DeleteAppRequest): DeleteAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppWithOptions(request, runtime);
}

model DeleteDomainRequest {
  domainName?: string(name='DomainName'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteDomainResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteDomainResponseBody(name='body'),
}

async function deleteDomainWithOptions(request: DeleteDomainRequest, runtime: Util.RuntimeOptions): DeleteDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDomain',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDomain(request: DeleteDomainRequest): DeleteDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDomainWithOptions(request, runtime);
}

model DeleteDomainCertificateRequest {
  certificateId?: string(name='CertificateId'),
  domainName?: string(name='DomainName'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteDomainCertificateResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteDomainCertificateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteDomainCertificateResponseBody(name='body'),
}

async function deleteDomainCertificateWithOptions(request: DeleteDomainCertificateRequest, runtime: Util.RuntimeOptions): DeleteDomainCertificateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.certificateId)) {
    query['CertificateId'] = request.certificateId;
  }
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDomainCertificate',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDomainCertificate(request: DeleteDomainCertificateRequest): DeleteDomainCertificateResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDomainCertificateWithOptions(request, runtime);
}

model DeleteIpControlRequest {
  ipControlId?: string(name='IpControlId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteIpControlResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteIpControlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteIpControlResponseBody(name='body'),
}

async function deleteIpControlWithOptions(request: DeleteIpControlRequest, runtime: Util.RuntimeOptions): DeleteIpControlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipControlId)) {
    query['IpControlId'] = request.ipControlId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIpControl',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteIpControl(request: DeleteIpControlRequest): DeleteIpControlResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIpControlWithOptions(request, runtime);
}

model DeleteLogConfigRequest {
  logType?: string(name='LogType'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteLogConfigResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteLogConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteLogConfigResponseBody(name='body'),
}

async function deleteLogConfigWithOptions(request: DeleteLogConfigRequest, runtime: Util.RuntimeOptions): DeleteLogConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.logType)) {
    query['LogType'] = request.logType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteLogConfig',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteLogConfig(request: DeleteLogConfigRequest): DeleteLogConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteLogConfigWithOptions(request, runtime);
}

model DeleteSecretKeyRequest {
  secretKeyId?: string(name='SecretKeyId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteSecretKeyResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteSecretKeyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSecretKeyResponseBody(name='body'),
}

async function deleteSecretKeyWithOptions(request: DeleteSecretKeyRequest, runtime: Util.RuntimeOptions): DeleteSecretKeyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.secretKeyId)) {
    query['SecretKeyId'] = request.secretKeyId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSecretKey',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSecretKey(request: DeleteSecretKeyRequest): DeleteSecretKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSecretKeyWithOptions(request, runtime);
}

model DeleteTrafficControlRequest {
  securityToken?: string(name='SecurityToken'),
  trafficControlId?: string(name='TrafficControlId'),
}

model DeleteTrafficControlResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteTrafficControlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteTrafficControlResponseBody(name='body'),
}

async function deleteTrafficControlWithOptions(request: DeleteTrafficControlRequest, runtime: Util.RuntimeOptions): DeleteTrafficControlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.trafficControlId)) {
    query['TrafficControlId'] = request.trafficControlId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTrafficControl',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteTrafficControl(request: DeleteTrafficControlRequest): DeleteTrafficControlResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTrafficControlWithOptions(request, runtime);
}

model DeleteTrafficSpecialControlRequest {
  securityToken?: string(name='SecurityToken'),
  specialKey?: string(name='SpecialKey'),
  specialType?: string(name='SpecialType'),
  trafficControlId?: string(name='TrafficControlId'),
}

model DeleteTrafficSpecialControlResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteTrafficSpecialControlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteTrafficSpecialControlResponseBody(name='body'),
}

async function deleteTrafficSpecialControlWithOptions(request: DeleteTrafficSpecialControlRequest, runtime: Util.RuntimeOptions): DeleteTrafficSpecialControlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.specialKey)) {
    query['SpecialKey'] = request.specialKey;
  }
  if (!Util.isUnset(request.specialType)) {
    query['SpecialType'] = request.specialType;
  }
  if (!Util.isUnset(request.trafficControlId)) {
    query['TrafficControlId'] = request.trafficControlId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTrafficSpecialControl',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteTrafficSpecialControl(request: DeleteTrafficSpecialControlRequest): DeleteTrafficSpecialControlResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTrafficSpecialControlWithOptions(request, runtime);
}

model DeployApiRequest {
  apiId?: string(name='ApiId'),
  description?: string(name='Description'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
  supportMock?: string(name='SupportMock'),
}

model DeployApiResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeployApiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeployApiResponseBody(name='body'),
}

async function deployApiWithOptions(request: DeployApiRequest, runtime: Util.RuntimeOptions): DeployApiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  if (!Util.isUnset(request.supportMock)) {
    query['SupportMock'] = request.supportMock;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeployApi',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deployApi(request: DeployApiRequest): DeployApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return deployApiWithOptions(request, runtime);
}

model DescribeApiRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeApiResponseBody = {
  allowSignatureMethod?: string(name='AllowSignatureMethod'),
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  appCodeAuthType?: string(name='AppCodeAuthType'),
  authType?: string(name='AuthType'),
  constantParameters?: {
    constantParameter?: [ 
    {
      constantValue?: string(name='ConstantValue'),
      description?: string(name='Description'),
      location?: string(name='Location'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='ConstantParameter')
  }(name='ConstantParameters'),
  createdTime?: string(name='CreatedTime'),
  customSystemParameters?: {
    customSystemParameter?: [ 
    {
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      location?: string(name='Location'),
      parameterName?: string(name='ParameterName'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='CustomSystemParameter')
  }(name='CustomSystemParameters'),
  deployedInfos?: {
    deployedInfo?: [ 
    {
      deployedStatus?: string(name='DeployedStatus'),
      effectiveVersion?: string(name='EffectiveVersion'),
      stageName?: string(name='StageName'),
    }
  ](name='DeployedInfo')
  }(name='DeployedInfos'),
  description?: string(name='Description'),
  disableInternet?: boolean(name='DisableInternet'),
  errorCodeSamples?: {
    errorCodeSample?: [ 
    {
      code?: string(name='Code'),
      description?: string(name='Description'),
      message?: string(name='Message'),
      model?: string(name='Model'),
    }
  ](name='ErrorCodeSample')
  }(name='ErrorCodeSamples'),
  failResultSample?: string(name='FailResultSample'),
  forceNonceCheck?: boolean(name='ForceNonceCheck'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  mock?: string(name='Mock'),
  mockResult?: string(name='MockResult'),
  modifiedTime?: string(name='ModifiedTime'),
  openIdConnectConfig?: {
    idTokenParamName?: string(name='IdTokenParamName'),
    openIdApiType?: string(name='OpenIdApiType'),
    publicKey?: string(name='PublicKey'),
    publicKeyId?: string(name='PublicKeyId'),
  }(name='OpenIdConnectConfig'),
  originResultDescription?: string(name='OriginResultDescription'),
  parametersMapObject?: {
    serviceParameterMap?: [ 
    {
      requestParameterName?: string(name='RequestParameterName'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='ServiceParameterMap')
  }(name='ParametersMapObject'),
  regionId?: string(name='RegionId'),
  requestConfig?: {
    bodyFormat?: string(name='BodyFormat'),
    bodyModel?: string(name='BodyModel'),
    postBodyDescription?: string(name='PostBodyDescription'),
    requestHttpMethod?: string(name='RequestHttpMethod'),
    requestMode?: string(name='RequestMode'),
    requestPath?: string(name='RequestPath'),
    requestProtocol?: string(name='RequestProtocol'),
  }(name='RequestConfig'),
  requestId?: string(name='RequestId'),
  requestParametersObject?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      arrayItemsType?: string(name='ArrayItemsType'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      docOrder?: string(name='DocOrder'),
      docShow?: string(name='DocShow'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      location?: string(name='Location'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
    }
  ](name='RequestParam')
  }(name='RequestParametersObject'),
  resultBodyModel?: string(name='ResultBodyModel'),
  resultSample?: string(name='ResultSample'),
  resultType?: string(name='ResultType'),
  serviceConfig?: {
    aoneAppName?: string(name='AoneAppName'),
    contentTypeCatagory?: string(name='ContentTypeCatagory'),
    contentTypeValue?: string(name='ContentTypeValue'),
    functionComputeConfig?: {
      fcRegionId?: string(name='FcRegionId'),
      functionName?: string(name='FunctionName'),
      qualifier?: string(name='Qualifier'),
      roleArn?: string(name='RoleArn'),
      serviceName?: string(name='ServiceName'),
    }(name='FunctionComputeConfig'),
    innerServiceInfo?: string(name='InnerServiceInfo'),
    innerServiceType?: string(name='InnerServiceType'),
    mock?: string(name='Mock'),
    mockHeaders?: {
      mockHeader?: [ 
      {
        headerName?: string(name='HeaderName'),
        headerValue?: string(name='HeaderValue'),
      }
    ](name='MockHeader')
    }(name='MockHeaders'),
    mockResult?: string(name='MockResult'),
    mockStatusCode?: int32(name='MockStatusCode'),
    serviceAddress?: string(name='ServiceAddress'),
    serviceHttpMethod?: string(name='ServiceHttpMethod'),
    servicePath?: string(name='ServicePath'),
    serviceProtocol?: string(name='ServiceProtocol'),
    serviceTimeout?: string(name='ServiceTimeout'),
    serviceVpcEnable?: string(name='ServiceVpcEnable'),
    vpcConfig?: {
      id?: string(name='Id'),
      instanceId?: string(name='InstanceId'),
      name?: string(name='Name'),
      port?: int32(name='Port'),
      vpcId?: string(name='VpcId'),
      vpcScheme?: string(name='VpcScheme'),
    }(name='VpcConfig'),
  }(name='ServiceConfig'),
  serviceParametersObject?: {
    serviceParam?: [ 
    {
      location?: string(name='Location'),
      serviceParameterName?: string(name='ServiceParameterName'),
      type?: string(name='Type'),
    }
  ](name='ServiceParam')
  }(name='ServiceParametersObject'),
  systemParameters?: {
    systemParameter?: [ 
    {
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      location?: string(name='Location'),
      parameterName?: string(name='ParameterName'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='SystemParameter')
  }(name='SystemParameters'),
  visibility?: string(name='Visibility'),
  webSocketApiType?: string(name='WebSocketApiType'),
}

model DescribeApiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiResponseBody(name='body'),
}

async function describeApiWithOptions(request: DescribeApiRequest, runtime: Util.RuntimeOptions): DescribeApiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApi',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApi(request: DescribeApiRequest): DescribeApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiWithOptions(request, runtime);
}

model DescribeApiDocRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeApiDocResponseBody = {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  bodyFormat?: string(name='BodyFormat'),
  deployedTime?: string(name='DeployedTime'),
  description?: string(name='Description'),
  disableInternet?: boolean(name='DisableInternet'),
  errorCodeSamples?: {
    errorCodeSample?: [ 
    {
      code?: string(name='Code'),
      description?: string(name='Description'),
      message?: string(name='Message'),
    }
  ](name='ErrorCodeSample')
  }(name='ErrorCodeSamples'),
  failResultSample?: string(name='FailResultSample'),
  forceNonceCheck?: boolean(name='ForceNonceCheck'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  httpMethod?: string(name='HttpMethod'),
  httpProtocol?: string(name='HttpProtocol'),
  mock?: string(name='Mock'),
  mockResult?: string(name='MockResult'),
  originResultDescription?: string(name='OriginResultDescription'),
  path?: string(name='Path'),
  pathParameters?: {
    pathParameter?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
    }
  ](name='PathParameter')
  }(name='PathParameters'),
  postBodyDescription?: string(name='PostBodyDescription'),
  postBodyType?: string(name='PostBodyType'),
  regionId?: string(name='RegionId'),
  requestBody?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      arrayItemsType?: string(name='ArrayItemsType'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
    }
  ](name='RequestParam')
  }(name='RequestBody'),
  requestHeaders?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      arrayItemsType?: string(name='ArrayItemsType'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
    }
  ](name='RequestParam')
  }(name='RequestHeaders'),
  requestId?: string(name='RequestId'),
  requestMode?: string(name='RequestMode'),
  requestQueries?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      arrayItemsType?: string(name='ArrayItemsType'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
    }
  ](name='RequestParam')
  }(name='RequestQueries'),
  resultSample?: string(name='ResultSample'),
  resultType?: string(name='ResultType'),
  serviceTimeout?: int32(name='ServiceTimeout'),
  serviceVpcEnable?: string(name='ServiceVpcEnable'),
  stageName?: string(name='StageName'),
  vpcName?: string(name='VpcName'),
}

model DescribeApiDocResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiDocResponseBody(name='body'),
}

async function describeApiDocWithOptions(request: DescribeApiDocRequest, runtime: Util.RuntimeOptions): DescribeApiDocResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiDoc',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiDoc(request: DescribeApiDocRequest): DescribeApiDocResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiDocWithOptions(request, runtime);
}

model DescribeApiDocsRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeApiDocsResponseBody = {
  apiInfos?: {
    apiInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      deployedTime?: string(name='DeployedTime'),
      description?: string(name='Description'),
      groupDescription?: string(name='GroupDescription'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      regionId?: string(name='RegionId'),
      stageName?: string(name='StageName'),
    }
  ](name='ApiInfo')
  }(name='ApiInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApiDocsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiDocsResponseBody(name='body'),
}

async function describeApiDocsWithOptions(request: DescribeApiDocsRequest, runtime: Util.RuntimeOptions): DescribeApiDocsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiDocs',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiDocs(request: DescribeApiDocsRequest): DescribeApiDocsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiDocsWithOptions(request, runtime);
}

model DescribeApiErrorRequest {
  apiId?: string(name='ApiId'),
  endTime?: string(name='EndTime'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime'),
}

model DescribeApiErrorResponseBody = {
  clientErrors?: {
    clientError?: [ 
    {
      time?: string(name='Time'),
      value?: string(name='Value'),
    }
  ](name='ClientError')
  }(name='ClientErrors'),
  requestId?: string(name='RequestId'),
  serverErrors?: {
    serverError?: [ 
    {
      time?: string(name='Time'),
      value?: string(name='Value'),
    }
  ](name='ServerError')
  }(name='ServerErrors'),
}

model DescribeApiErrorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiErrorResponseBody(name='body'),
}

async function describeApiErrorWithOptions(request: DescribeApiErrorRequest, runtime: Util.RuntimeOptions): DescribeApiErrorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiError',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiError(request: DescribeApiErrorRequest): DescribeApiErrorResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiErrorWithOptions(request, runtime);
}

model DescribeApiGroupDetailRequest {
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeApiGroupDetailResponseBody = {
  billingStatus?: string(name='BillingStatus'),
  classicVpcSubDomain?: string(name='ClassicVpcSubDomain'),
  compatibleFlags?: string(name='CompatibleFlags'),
  createdTime?: string(name='CreatedTime'),
  customTraceConfig?: string(name='CustomTraceConfig'),
  defaultDomain?: string(name='DefaultDomain'),
  description?: string(name='Description'),
  domainItems?: {
    domainItem?: [ 
    {
      bindStageName?: string(name='BindStageName'),
      certificateId?: string(name='CertificateId'),
      certificateName?: string(name='CertificateName'),
      domainBindingStatus?: string(name='DomainBindingStatus'),
      domainLegalStatus?: string(name='DomainLegalStatus'),
      domainName?: string(name='DomainName'),
      domainNameResolution?: string(name='DomainNameResolution'),
      domainRemark?: string(name='DomainRemark'),
      domainWebSocketStatus?: string(name='DomainWebSocketStatus'),
      wildcardDomainPatterns?: string(name='WildcardDomainPatterns'),
    }
  ](name='DomainItem')
  }(name='DomainItems'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  httpsPolicy?: string(name='HttpsPolicy'),
  illegalStatus?: string(name='IllegalStatus'),
  instanceId?: string(name='InstanceId'),
  instanceName?: string(name='InstanceName'),
  instanceType?: string(name='InstanceType'),
  instanceVipList?: string(name='InstanceVipList'),
  ipv6Status?: string(name='Ipv6Status'),
  modifiedTime?: string(name='ModifiedTime'),
  passthroughHeaders?: string(name='PassthroughHeaders'),
  regionId?: string(name='RegionId'),
  requestId?: string(name='RequestId'),
  rpcPattern?: string(name='RpcPattern'),
  stageItems?: {
    stageInfo?: [ 
    {
      description?: string(name='Description'),
      stageId?: string(name='StageId'),
      stageName?: string(name='StageName'),
    }
  ](name='StageInfo')
  }(name='StageItems'),
  status?: string(name='Status'),
  subDomain?: string(name='SubDomain'),
  trafficLimit?: int32(name='TrafficLimit'),
  userLogConfig?: string(name='UserLogConfig'),
  vpcDomain?: string(name='VpcDomain'),
}

model DescribeApiGroupDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiGroupDetailResponseBody(name='body'),
}

async function describeApiGroupDetailWithOptions(request: DescribeApiGroupDetailRequest, runtime: Util.RuntimeOptions): DescribeApiGroupDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiGroupDetail',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiGroupDetail(request: DescribeApiGroupDetailRequest): DescribeApiGroupDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiGroupDetailWithOptions(request, runtime);
}

model DescribeApiGroupDetailForConsumerRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeApiGroupDetailForConsumerResponseBody = {
  billingStatus?: string(name='BillingStatus'),
  createdTime?: string(name='CreatedTime'),
  description?: string(name='Description'),
  domainItems?: {
    domainItem?: [ 
    {
      certificateId?: string(name='CertificateId'),
      certificateName?: string(name='CertificateName'),
      domainName?: string(name='DomainName'),
      domainNameResolution?: string(name='DomainNameResolution'),
      domainStatus?: string(name='DomainStatus'),
    }
  ](name='DomainItem')
  }(name='DomainItems'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  illegalStatus?: string(name='IllegalStatus'),
  modifiedTime?: string(name='ModifiedTime'),
  purchased?: string(name='Purchased'),
  regionId?: string(name='RegionId'),
  requestId?: string(name='RequestId'),
  status?: string(name='Status'),
  subDomain?: string(name='SubDomain'),
  trafficLimit?: int32(name='TrafficLimit'),
}

model DescribeApiGroupDetailForConsumerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiGroupDetailForConsumerResponseBody(name='body'),
}

async function describeApiGroupDetailForConsumerWithOptions(request: DescribeApiGroupDetailForConsumerRequest, runtime: Util.RuntimeOptions): DescribeApiGroupDetailForConsumerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiGroupDetailForConsumer',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiGroupDetailForConsumer(request: DescribeApiGroupDetailForConsumerRequest): DescribeApiGroupDetailForConsumerResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiGroupDetailForConsumerWithOptions(request, runtime);
}

model DescribeApiGroupsRequest {
  enableTagAuth?: boolean(name='EnableTagAuth'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  instanceId?: string(name='InstanceId'),
  notClassic?: boolean(name='NotClassic'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model DescribeApiGroupsResponseBody = {
  apiGroupAttributes?: {
    apiGroupAttribute?: [ 
    {
      billingStatus?: string(name='BillingStatus'),
      createdTime?: string(name='CreatedTime'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      httpsPolicy?: string(name='HttpsPolicy'),
      illegalStatus?: string(name='IllegalStatus'),
      instanceId?: string(name='InstanceId'),
      instanceType?: string(name='InstanceType'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
      subDomain?: string(name='SubDomain'),
      trafficLimit?: int32(name='TrafficLimit'),
    }
  ](name='ApiGroupAttribute')
  }(name='ApiGroupAttributes'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApiGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiGroupsResponseBody(name='body'),
}

async function describeApiGroupsWithOptions(request: DescribeApiGroupsRequest, runtime: Util.RuntimeOptions): DescribeApiGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.enableTagAuth)) {
    query['EnableTagAuth'] = request.enableTagAuth;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.notClassic)) {
    query['NotClassic'] = request.notClassic;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiGroups',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiGroups(request: DescribeApiGroupsRequest): DescribeApiGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiGroupsWithOptions(request, runtime);
}

model DescribeApiIpControlsRequest {
  apiIds?: string(name='ApiIds'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeApiIpControlsResponseBody = {
  apiIpControls?: {
    apiIpControlItem?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      boundTime?: string(name='BoundTime'),
      ipControlId?: string(name='IpControlId'),
      ipControlName?: string(name='IpControlName'),
    }
  ](name='ApiIpControlItem')
  }(name='ApiIpControls'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApiIpControlsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiIpControlsResponseBody(name='body'),
}

async function describeApiIpControlsWithOptions(request: DescribeApiIpControlsRequest, runtime: Util.RuntimeOptions): DescribeApiIpControlsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiIds)) {
    query['ApiIds'] = request.apiIds;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiIpControls',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiIpControls(request: DescribeApiIpControlsRequest): DescribeApiIpControlsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiIpControlsWithOptions(request, runtime);
}

model DescribeApiLatencyRequest {
  apiId?: string(name='ApiId'),
  endTime?: string(name='EndTime'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime'),
}

model DescribeApiLatencyResponseBody = {
  latencys?: {
    latency?: [ 
    {
      time?: string(name='Time'),
      value?: string(name='Value'),
    }
  ](name='Latency')
  }(name='Latencys'),
  requestId?: string(name='RequestId'),
}

model DescribeApiLatencyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiLatencyResponseBody(name='body'),
}

async function describeApiLatencyWithOptions(request: DescribeApiLatencyRequest, runtime: Util.RuntimeOptions): DescribeApiLatencyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiLatency',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiLatency(request: DescribeApiLatencyRequest): DescribeApiLatencyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiLatencyWithOptions(request, runtime);
}

model DescribeApiQpsRequest {
  apiId?: string(name='ApiId'),
  endTime?: string(name='EndTime'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime'),
}

model DescribeApiQpsResponseBody = {
  fails?: {
    fail?: [ 
    {
      time?: string(name='Time'),
      value?: string(name='Value'),
    }
  ](name='Fail')
  }(name='Fails'),
  requestId?: string(name='RequestId'),
  successes?: {
    success?: [ 
    {
      time?: string(name='Time'),
      value?: string(name='Value'),
    }
  ](name='Success')
  }(name='Successes'),
}

model DescribeApiQpsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiQpsResponseBody(name='body'),
}

async function describeApiQpsWithOptions(request: DescribeApiQpsRequest, runtime: Util.RuntimeOptions): DescribeApiQpsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiQps',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiQps(request: DescribeApiQpsRequest): DescribeApiQpsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiQpsWithOptions(request, runtime);
}

model DescribeApiRulesRequest {
  apiIds?: string(name='ApiIds'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  ruleType?: string(name='RuleType'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeApiRulesResponseBody = {
  apiRules?: {
    apiRule?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      createdTime?: string(name='CreatedTime'),
      ruleId?: string(name='RuleId'),
      ruleName?: string(name='RuleName'),
      ruleType?: string(name='RuleType'),
    }
  ](name='ApiRule')
  }(name='ApiRules'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApiRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiRulesResponseBody(name='body'),
}

async function describeApiRulesWithOptions(request: DescribeApiRulesRequest, runtime: Util.RuntimeOptions): DescribeApiRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiIds)) {
    query['ApiIds'] = request.apiIds;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.ruleType)) {
    query['RuleType'] = request.ruleType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiRules',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiRules(request: DescribeApiRulesRequest): DescribeApiRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiRulesWithOptions(request, runtime);
}

model DescribeApiStageDetailRequest {
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageId?: string(name='StageId'),
}

model DescribeApiStageDetailResponseBody = {
  createdTime?: string(name='CreatedTime'),
  description?: string(name='Description'),
  groupId?: string(name='GroupId'),
  modifiedTime?: string(name='ModifiedTime'),
  requestId?: string(name='RequestId'),
  stageId?: string(name='StageId'),
  stageName?: string(name='StageName'),
  variables?: {
    variableItem?: [ 
    {
      stageRouteModel?: {
        location?: string(name='Location'),
        parameterCatalog?: string(name='ParameterCatalog'),
        parameterType?: string(name='ParameterType'),
        routeMatchSymbol?: string(name='RouteMatchSymbol'),
        routeRules?: {
          routeRuleItem?: [ 
          {
            conditionValue?: string(name='ConditionValue'),
            maxValue?: long(name='MaxValue'),
            minValue?: long(name='MinValue'),
            resultValue?: string(name='ResultValue'),
          }
        ](name='RouteRuleItem')
        }(name='RouteRules'),
        serviceParameterName?: string(name='ServiceParameterName'),
      }(name='StageRouteModel'),
      supportRoute?: boolean(name='SupportRoute'),
      variableName?: string(name='VariableName'),
      variableValue?: string(name='VariableValue'),
    }
  ](name='VariableItem')
  }(name='Variables'),
}

model DescribeApiStageDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiStageDetailResponseBody(name='body'),
}

async function describeApiStageDetailWithOptions(request: DescribeApiStageDetailRequest, runtime: Util.RuntimeOptions): DescribeApiStageDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageId)) {
    query['StageId'] = request.stageId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiStageDetail',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiStageDetail(request: DescribeApiStageDetailRequest): DescribeApiStageDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiStageDetailWithOptions(request, runtime);
}

model DescribeApiTrafficRequest {
  apiId?: string(name='ApiId'),
  endTime?: string(name='EndTime'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime'),
}

model DescribeApiTrafficResponseBody = {
  downloads?: {
    download?: [ 
    {
      time?: string(name='Time'),
      value?: string(name='Value'),
    }
  ](name='Download')
  }(name='Downloads'),
  requestId?: string(name='RequestId'),
  uploads?: {
    upload?: [ 
    {
      time?: string(name='Time'),
      value?: string(name='Value'),
    }
  ](name='Upload')
  }(name='Uploads'),
}

model DescribeApiTrafficResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApiTrafficResponseBody(name='body'),
}

async function describeApiTrafficWithOptions(request: DescribeApiTrafficRequest, runtime: Util.RuntimeOptions): DescribeApiTrafficResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiTraffic',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiTraffic(request: DescribeApiTrafficRequest): DescribeApiTrafficResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiTrafficWithOptions(request, runtime);
}

model DescribeApisRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  visibility?: string(name='Visibility'),
}

model DescribeApisResponseBody = {
  apiInfos?: {
    apiInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      createdTime?: string(name='CreatedTime'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
      visibility?: string(name='Visibility'),
    }
  ](name='ApiInfo')
  }(name='ApiInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApisResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApisResponseBody(name='body'),
}

async function describeApisWithOptions(request: DescribeApisRequest, runtime: Util.RuntimeOptions): DescribeApisResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.visibility)) {
    query['Visibility'] = request.visibility;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApis',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApis(request: DescribeApisRequest): DescribeApisResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApisWithOptions(request, runtime);
}

model DescribeApisByAppRequest {
  appId?: long(name='AppId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeApisByAppResponseBody = {
  appApiRelationInfos?: {
    appApiRelationInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      authVaildTime?: string(name='AuthVaildTime'),
      authorizationSource?: string(name='AuthorizationSource'),
      createdTime?: string(name='CreatedTime'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      operator?: string(name='Operator'),
      regionId?: string(name='RegionId'),
      stageName?: string(name='StageName'),
    }
  ](name='AppApiRelationInfo')
  }(name='AppApiRelationInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApisByAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApisByAppResponseBody(name='body'),
}

async function describeApisByAppWithOptions(request: DescribeApisByAppRequest, runtime: Util.RuntimeOptions): DescribeApisByAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApisByApp',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApisByApp(request: DescribeApisByAppRequest): DescribeApisByAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApisByAppWithOptions(request, runtime);
}

model DescribeApisByIpControlRequest {
  ipControlId?: string(name='IpControlId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeApisByIpControlResponseBody = {
  apiInfos?: {
    apiInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      boundTime?: string(name='BoundTime'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      regionId?: string(name='RegionId'),
      stageName?: string(name='StageName'),
      visibility?: string(name='Visibility'),
    }
  ](name='ApiInfo')
  }(name='ApiInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApisByIpControlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApisByIpControlResponseBody(name='body'),
}

async function describeApisByIpControlWithOptions(request: DescribeApisByIpControlRequest, runtime: Util.RuntimeOptions): DescribeApisByIpControlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipControlId)) {
    query['IpControlId'] = request.ipControlId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApisByIpControl',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApisByIpControl(request: DescribeApisByIpControlRequest): DescribeApisByIpControlResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApisByIpControlWithOptions(request, runtime);
}

model DescribeApisByRuleRequest {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  ruleId?: string(name='RuleId'),
  ruleType?: string(name='RuleType'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeApisByRuleResponseBody = {
  apiInfos?: {
    apiInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      createdTime?: string(name='CreatedTime'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
      stageName?: string(name='StageName'),
      visibility?: string(name='Visibility'),
    }
  ](name='ApiInfo')
  }(name='ApiInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApisByRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApisByRuleResponseBody(name='body'),
}

async function describeApisByRuleWithOptions(request: DescribeApisByRuleRequest, runtime: Util.RuntimeOptions): DescribeApisByRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.ruleType)) {
    query['RuleType'] = request.ruleType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApisByRule',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApisByRule(request: DescribeApisByRuleRequest): DescribeApisByRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApisByRuleWithOptions(request, runtime);
}

model DescribeApisForConsoleRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
  visibility?: string(name='Visibility'),
}

model DescribeApisForConsoleResponseBody = {
  apiInfos?: {
    apiInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      createdTime?: string(name='CreatedTime'),
      deployedInfos?: {
        deployedInfo?: [ 
        {
          deployedStatus?: string(name='DeployedStatus'),
          effectiveVersion?: string(name='EffectiveVersion'),
          stageName?: string(name='StageName'),
        }
      ](name='DeployedInfo')
      }(name='DeployedInfos'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
      visibility?: string(name='Visibility'),
    }
  ](name='ApiInfo')
  }(name='ApiInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApisForConsoleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApisForConsoleResponseBody(name='body'),
}

async function describeApisForConsoleWithOptions(request: DescribeApisForConsoleRequest, runtime: Util.RuntimeOptions): DescribeApisForConsoleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  if (!Util.isUnset(request.visibility)) {
    query['Visibility'] = request.visibility;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApisForConsole',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApisForConsole(request: DescribeApisForConsoleRequest): DescribeApisForConsoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApisForConsoleWithOptions(request, runtime);
}

model DescribeAppRequest {
  appId?: long(name='AppId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeAppResponseBody = {
  appId?: long(name='AppId'),
  appName?: string(name='AppName'),
  createdTime?: string(name='CreatedTime'),
  description?: string(name='Description'),
  modifiedTime?: string(name='ModifiedTime'),
  requestId?: string(name='RequestId'),
}

model DescribeAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAppResponseBody(name='body'),
}

async function describeAppWithOptions(request: DescribeAppRequest, runtime: Util.RuntimeOptions): DescribeAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApp',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApp(request: DescribeAppRequest): DescribeAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppWithOptions(request, runtime);
}

model DescribeAppSecuritiesRequest {
  appId?: long(name='AppId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeAppSecuritiesResponseBody = {
  appSecuritys?: {
    appSecurity?: [ 
    {
      appCode?: string(name='AppCode'),
      appKey?: string(name='AppKey'),
      appSecret?: string(name='AppSecret'),
      createdTime?: string(name='CreatedTime'),
      modifiedTime?: string(name='ModifiedTime'),
    }
  ](name='AppSecurity')
  }(name='AppSecuritys'),
  requestId?: string(name='RequestId'),
}

model DescribeAppSecuritiesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAppSecuritiesResponseBody(name='body'),
}

async function describeAppSecuritiesWithOptions(request: DescribeAppSecuritiesRequest, runtime: Util.RuntimeOptions): DescribeAppSecuritiesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAppSecurities',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAppSecurities(request: DescribeAppSecuritiesRequest): DescribeAppSecuritiesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppSecuritiesWithOptions(request, runtime);
}

model DescribeAppSecurityRequest {
  appKey?: string(name='AppKey'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeAppSecurityResponseBody = {
  appCode?: string(name='AppCode'),
  appKey?: string(name='AppKey'),
  appSecret?: string(name='AppSecret'),
  createdTime?: string(name='CreatedTime'),
  modifiedTime?: string(name='ModifiedTime'),
  requestId?: string(name='RequestId'),
}

model DescribeAppSecurityResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAppSecurityResponseBody(name='body'),
}

async function describeAppSecurityWithOptions(request: DescribeAppSecurityRequest, runtime: Util.RuntimeOptions): DescribeAppSecurityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAppSecurity',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAppSecurity(request: DescribeAppSecurityRequest): DescribeAppSecurityResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppSecurityWithOptions(request, runtime);
}

model DescribeAppsRequest {
  appId?: long(name='AppId'),
  appName?: string(name='AppName'),
  enableTagAuth?: boolean(name='EnableTagAuth'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model DescribeAppsResponseBody = {
  apps?: {
    app?: [ 
    {
      appId?: long(name='AppId'),
      appName?: string(name='AppName'),
      createdTime?: string(name='CreatedTime'),
      description?: string(name='Description'),
      modifiedTime?: string(name='ModifiedTime'),
    }
  ](name='App')
  }(name='Apps'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeAppsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAppsResponseBody(name='body'),
}

async function describeAppsWithOptions(request: DescribeAppsRequest, runtime: Util.RuntimeOptions): DescribeAppsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.enableTagAuth)) {
    query['EnableTagAuth'] = request.enableTagAuth;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApps',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApps(request: DescribeAppsRequest): DescribeAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppsWithOptions(request, runtime);
}

model DescribeAppsByApiRequest {
  apiId?: string(name='ApiId'),
  appId?: long(name='AppId'),
  appName?: string(name='AppName'),
  appOwnerId?: long(name='AppOwnerId'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeAppsByApiResponseBody = {
  appApiRelationInfos?: {
    appApiRelationInfo?: [ 
    {
      appId?: string(name='AppId'),
      appName?: string(name='AppName'),
      authVaildTime?: string(name='AuthVaildTime'),
      authorizationSource?: string(name='AuthorizationSource'),
      createdTime?: string(name='CreatedTime'),
      description?: string(name='Description'),
      operator?: string(name='Operator'),
      stageName?: string(name='StageName'),
    }
  ](name='AppApiRelationInfo')
  }(name='AppApiRelationInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeAppsByApiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAppsByApiResponseBody(name='body'),
}

async function describeAppsByApiWithOptions(request: DescribeAppsByApiRequest, runtime: Util.RuntimeOptions): DescribeAppsByApiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.appOwnerId)) {
    query['AppOwnerId'] = request.appOwnerId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAppsByApi',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAppsByApi(request: DescribeAppsByApiRequest): DescribeAppsByApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppsByApiWithOptions(request, runtime);
}

model DescribeAppsForProviderRequest {
  appId?: long(name='AppId'),
  appOwnerId?: long(name='AppOwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeAppsForProviderResponseBody = {
  apps?: {
    app?: [ 
    {
      appId?: long(name='AppId'),
      appName?: string(name='AppName'),
      createTime?: string(name='CreateTime'),
      description?: string(name='Description'),
      modifiedTime?: string(name='ModifiedTime'),
    }
  ](name='App')
  }(name='Apps'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeAppsForProviderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAppsForProviderResponseBody(name='body'),
}

async function describeAppsForProviderWithOptions(request: DescribeAppsForProviderRequest, runtime: Util.RuntimeOptions): DescribeAppsForProviderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appOwnerId)) {
    query['AppOwnerId'] = request.appOwnerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAppsForProvider',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAppsForProvider(request: DescribeAppsForProviderRequest): DescribeAppsForProviderResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppsForProviderWithOptions(request, runtime);
}

model DescribeBlackListsRequest {
  blackType?: string(name='BlackType'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeBlackListsResponseBody = {
  blackLists?: {
    blackList?: [ 
    {
      blackContent?: string(name='BlackContent'),
      blackType?: string(name='BlackType'),
      createTime?: string(name='CreateTime'),
      description?: string(name='Description'),
      modifiedTime?: string(name='ModifiedTime'),
    }
  ](name='BlackList')
  }(name='BlackLists'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeBlackListsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeBlackListsResponseBody(name='body'),
}

async function describeBlackListsWithOptions(request: DescribeBlackListsRequest, runtime: Util.RuntimeOptions): DescribeBlackListsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.blackType)) {
    query['BlackType'] = request.blackType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBlackLists',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeBlackLists(request: DescribeBlackListsRequest): DescribeBlackListsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBlackListsWithOptions(request, runtime);
}

model DescribeDeployedApiRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeDeployedApiResponseBody = {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  authType?: string(name='AuthType'),
  bodyFormat?: string(name='BodyFormat'),
  constantParameters?: {
    constantParameter?: [ 
    {
      constantValue?: string(name='ConstantValue'),
      description?: string(name='Description'),
      location?: string(name='Location'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='ConstantParameter')
  }(name='ConstantParameters'),
  deployedTime?: string(name='DeployedTime'),
  disableInternet?: boolean(name='DisableInternet'),
  errorCodeSamples?: {
    errorCodeSample?: [ 
    {
      code?: string(name='Code'),
      description?: string(name='Description'),
      message?: string(name='Message'),
    }
  ](name='ErrorCodeSample')
  }(name='ErrorCodeSamples'),
  failResultSample?: string(name='FailResultSample'),
  forceNonceCheck?: boolean(name='ForceNonceCheck'),
  functionComputeConfig?: {
    fcRegionId?: string(name='FcRegionId'),
    functionName?: string(name='FunctionName'),
    roleArn?: string(name='RoleArn'),
    serviceName?: string(name='ServiceName'),
  }(name='FunctionComputeConfig'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  httpMethod?: string(name='HttpMethod'),
  httpProtocol?: string(name='HttpProtocol'),
  path?: string(name='Path'),
  pathParameters?: {
    pathParameter?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='PathParameter')
  }(name='PathParameters'),
  postBodyDescription?: string(name='PostBodyDescription'),
  postBodyType?: string(name='PostBodyType'),
  regionId?: string(name='RegionId'),
  requestBody?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      arrayItemsType?: string(name='ArrayItemsType'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      docOrder?: string(name='DocOrder'),
      docShow?: string(name='DocShow'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='RequestParam')
  }(name='RequestBody'),
  requestHeaders?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      arrayItemsType?: string(name='ArrayItemsType'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      docOrder?: string(name='DocOrder'),
      docShow?: string(name='DocShow'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='RequestParam')
  }(name='RequestHeaders'),
  requestId?: string(name='RequestId'),
  requestMode?: string(name='RequestMode'),
  requestQueries?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      arrayItemsType?: string(name='ArrayItemsType'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      docOrder?: string(name='DocOrder'),
      docShow?: string(name='DocShow'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='RequestParam')
  }(name='RequestQueries'),
  resultSample?: string(name='ResultSample'),
  resultType?: string(name='ResultType'),
  serviceAddress?: string(name='ServiceAddress'),
  serviceFCEnable?: string(name='ServiceFCEnable'),
  serviceProtocol?: string(name='ServiceProtocol'),
  serviceTimeout?: int32(name='ServiceTimeout'),
  serviceVpcEnable?: string(name='ServiceVpcEnable'),
  stageName?: string(name='StageName'),
  systemParameters?: {
    systemParameter?: [ 
    {
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      location?: string(name='Location'),
      parameterName?: string(name='ParameterName'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='SystemParameter')
  }(name='SystemParameters'),
  visibility?: string(name='Visibility'),
  vpcName?: string(name='VpcName'),
}

model DescribeDeployedApiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeDeployedApiResponseBody(name='body'),
}

async function describeDeployedApiWithOptions(request: DescribeDeployedApiRequest, runtime: Util.RuntimeOptions): DescribeDeployedApiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDeployedApi',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeDeployedApi(request: DescribeDeployedApiRequest): DescribeDeployedApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDeployedApiWithOptions(request, runtime);
}

model DescribeDeployedApisRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeDeployedApisResponseBody = {
  apiInfos?: {
    apiInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      deployedTime?: string(name='DeployedTime'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      regionId?: string(name='RegionId'),
      stageName?: string(name='StageName'),
      visibility?: string(name='Visibility'),
    }
  ](name='ApiInfo')
  }(name='ApiInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeDeployedApisResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeDeployedApisResponseBody(name='body'),
}

async function describeDeployedApisWithOptions(request: DescribeDeployedApisRequest, runtime: Util.RuntimeOptions): DescribeDeployedApisResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDeployedApis',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeDeployedApis(request: DescribeDeployedApisRequest): DescribeDeployedApisResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDeployedApisWithOptions(request, runtime);
}

model DescribeDomainRequest {
  domainName?: string(name='DomainName'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeDomainResponseBody = {
  certificateBody?: string(name='CertificateBody'),
  certificateId?: string(name='CertificateId'),
  certificateName?: string(name='CertificateName'),
  domainBindingStatus?: string(name='DomainBindingStatus'),
  domainLegalStatus?: string(name='DomainLegalStatus'),
  domainName?: string(name='DomainName'),
  domainNameResolution?: string(name='DomainNameResolution'),
  domainRemark?: string(name='DomainRemark'),
  domainWebSocketStatus?: string(name='DomainWebSocketStatus'),
  groupId?: string(name='GroupId'),
  privateKey?: string(name='PrivateKey'),
  requestId?: string(name='RequestId'),
  subDomain?: string(name='SubDomain'),
}

model DescribeDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeDomainResponseBody(name='body'),
}

async function describeDomainWithOptions(request: DescribeDomainRequest, runtime: Util.RuntimeOptions): DescribeDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomain',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeDomain(request: DescribeDomainRequest): DescribeDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainWithOptions(request, runtime);
}

model DescribeDomainResolutionRequest {
  domainNames?: string(name='DomainNames'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeDomainResolutionResponseBody = {
  domainResolutions?: {
    domainResolution?: [ 
    {
      domainName?: string(name='DomainName'),
      domainNameResolution?: string(name='DomainNameResolution'),
    }
  ](name='DomainResolution')
  }(name='DomainResolutions'),
  groupId?: string(name='GroupId'),
  requestId?: string(name='RequestId'),
}

model DescribeDomainResolutionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeDomainResolutionResponseBody(name='body'),
}

async function describeDomainResolutionWithOptions(request: DescribeDomainResolutionRequest, runtime: Util.RuntimeOptions): DescribeDomainResolutionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDomainResolution',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeDomainResolution(request: DescribeDomainResolutionRequest): DescribeDomainResolutionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainResolutionWithOptions(request, runtime);
}

model DescribeHistoryApiRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  historyVersion?: string(name='HistoryVersion'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeHistoryApiResponseBody = {
  allowSignatureMethod?: string(name='AllowSignatureMethod'),
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  authType?: string(name='AuthType'),
  bodyFormat?: string(name='BodyFormat'),
  constantParameters?: {
    constantParameter?: [ 
    {
      constantValue?: string(name='ConstantValue'),
      description?: string(name='Description'),
      location?: string(name='Location'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='ConstantParameter')
  }(name='ConstantParameters'),
  customSystemParameters?: {
    customSystemParameter?: [ 
    {
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      location?: string(name='Location'),
      parameterName?: string(name='ParameterName'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='CustomSystemParameter')
  }(name='CustomSystemParameters'),
  deployedTime?: string(name='DeployedTime'),
  description?: string(name='Description'),
  errorCodeSamples?: {
    errorCodeSample?: [ 
    {
      code?: string(name='Code'),
      description?: string(name='Description'),
      message?: string(name='Message'),
    }
  ](name='ErrorCodeSample')
  }(name='ErrorCodeSamples'),
  failResultSample?: string(name='FailResultSample'),
  functionComputeConfig?: {
    fcRegionId?: string(name='FcRegionId'),
    functionName?: string(name='FunctionName'),
    roleArn?: string(name='RoleArn'),
    serviceName?: string(name='ServiceName'),
  }(name='FunctionComputeConfig'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  historyVersion?: string(name='HistoryVersion'),
  httpMethod?: string(name='HttpMethod'),
  httpProtocol?: string(name='HttpProtocol'),
  mock?: string(name='Mock'),
  mockResult?: string(name='MockResult'),
  openIdConnectConfig?: {
    idTokenParamName?: string(name='IdTokenParamName'),
    openIdApiType?: string(name='OpenIdApiType'),
    publicKey?: string(name='PublicKey'),
    publicKeyId?: string(name='PublicKeyId'),
  }(name='OpenIdConnectConfig'),
  originResultDescription?: string(name='OriginResultDescription'),
  path?: string(name='Path'),
  pathParameters?: {
    pathParameter?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='PathParameter')
  }(name='PathParameters'),
  postBodyDescription?: string(name='PostBodyDescription'),
  postBodyType?: string(name='PostBodyType'),
  regionId?: string(name='RegionId'),
  requestBody?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      arrayItemsType?: string(name='ArrayItemsType'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      docOrder?: string(name='DocOrder'),
      docShow?: string(name='DocShow'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='RequestParam')
  }(name='RequestBody'),
  requestHeaders?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      arrayItemsType?: string(name='ArrayItemsType'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      docOrder?: string(name='DocOrder'),
      docShow?: string(name='DocShow'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='RequestParam')
  }(name='RequestHeaders'),
  requestId?: string(name='RequestId'),
  requestMode?: string(name='RequestMode'),
  requestQueries?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      arrayItemsType?: string(name='ArrayItemsType'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      docOrder?: string(name='DocOrder'),
      docShow?: string(name='DocShow'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='RequestParam')
  }(name='RequestQueries'),
  resultSample?: string(name='ResultSample'),
  resultType?: string(name='ResultType'),
  serviceAddress?: string(name='ServiceAddress'),
  serviceFCEnable?: string(name='ServiceFCEnable'),
  serviceProtocol?: string(name='ServiceProtocol'),
  serviceTimeout?: int32(name='ServiceTimeout'),
  serviceVpcEnable?: string(name='ServiceVpcEnable'),
  status?: string(name='Status'),
  systemParameters?: {
    systemParameter?: [ 
    {
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      location?: string(name='Location'),
      parameterName?: string(name='ParameterName'),
      serviceParameterName?: string(name='ServiceParameterName'),
    }
  ](name='SystemParameter')
  }(name='SystemParameters'),
  visibility?: string(name='Visibility'),
  vpcName?: string(name='VpcName'),
}

model DescribeHistoryApiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeHistoryApiResponseBody(name='body'),
}

async function describeHistoryApiWithOptions(request: DescribeHistoryApiRequest, runtime: Util.RuntimeOptions): DescribeHistoryApiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.historyVersion)) {
    query['HistoryVersion'] = request.historyVersion;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHistoryApi',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeHistoryApi(request: DescribeHistoryApiRequest): DescribeHistoryApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHistoryApiWithOptions(request, runtime);
}

model DescribeHistoryApisRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeHistoryApisResponseBody = {
  apiInfos?: {
    apiInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      deployedTime?: string(name='DeployedTime'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      historyVersion?: string(name='HistoryVersion'),
      regionId?: string(name='RegionId'),
      stageName?: string(name='StageName'),
      status?: string(name='Status'),
    }
  ](name='ApiInfo')
  }(name='ApiInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeHistoryApisResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeHistoryApisResponseBody(name='body'),
}

async function describeHistoryApisWithOptions(request: DescribeHistoryApisRequest, runtime: Util.RuntimeOptions): DescribeHistoryApisResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHistoryApis',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeHistoryApis(request: DescribeHistoryApisRequest): DescribeHistoryApisResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHistoryApisWithOptions(request, runtime);
}

model DescribeIpControlPolicyItemsRequest {
  ipControlId?: string(name='IpControlId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  policyItemId?: string(name='PolicyItemId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeIpControlPolicyItemsResponseBody = {
  ipControlPolicyItems?: {
    ipControlPolicyItem?: [ 
    {
      appId?: string(name='AppId'),
      cidrIp?: string(name='CidrIp'),
      createTime?: string(name='CreateTime'),
      modifiedTime?: string(name='ModifiedTime'),
      policyItemId?: string(name='PolicyItemId'),
    }
  ](name='IpControlPolicyItem')
  }(name='IpControlPolicyItems'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeIpControlPolicyItemsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeIpControlPolicyItemsResponseBody(name='body'),
}

async function describeIpControlPolicyItemsWithOptions(request: DescribeIpControlPolicyItemsRequest, runtime: Util.RuntimeOptions): DescribeIpControlPolicyItemsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipControlId)) {
    query['IpControlId'] = request.ipControlId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.policyItemId)) {
    query['PolicyItemId'] = request.policyItemId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeIpControlPolicyItems',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeIpControlPolicyItems(request: DescribeIpControlPolicyItemsRequest): DescribeIpControlPolicyItemsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeIpControlPolicyItemsWithOptions(request, runtime);
}

model DescribeIpControlsRequest {
  ipControlId?: string(name='IpControlId'),
  ipControlName?: string(name='IpControlName'),
  ipControlType?: string(name='IpControlType'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeIpControlsResponseBody = {
  ipControlInfos?: {
    ipControlInfo?: [ 
    {
      createTime?: string(name='CreateTime'),
      description?: string(name='Description'),
      ipControlId?: string(name='IpControlId'),
      ipControlName?: string(name='IpControlName'),
      ipControlType?: string(name='IpControlType'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
    }
  ](name='IpControlInfo')
  }(name='IpControlInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeIpControlsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeIpControlsResponseBody(name='body'),
}

async function describeIpControlsWithOptions(request: DescribeIpControlsRequest, runtime: Util.RuntimeOptions): DescribeIpControlsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipControlId)) {
    query['IpControlId'] = request.ipControlId;
  }
  if (!Util.isUnset(request.ipControlName)) {
    query['IpControlName'] = request.ipControlName;
  }
  if (!Util.isUnset(request.ipControlType)) {
    query['IpControlType'] = request.ipControlType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeIpControls',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeIpControls(request: DescribeIpControlsRequest): DescribeIpControlsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeIpControlsWithOptions(request, runtime);
}

model DescribeLogConfigRequest {
  logType?: string(name='LogType'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeLogConfigResponseBody = {
  logInfos?: {
    logInfo?: [ 
    {
      logType?: string(name='LogType'),
      regionId?: string(name='RegionId'),
      slsLogStore?: string(name='SlsLogStore'),
      slsProject?: string(name='SlsProject'),
    }
  ](name='LogInfo')
  }(name='LogInfos'),
  requestId?: string(name='RequestId'),
}

model DescribeLogConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeLogConfigResponseBody(name='body'),
}

async function describeLogConfigWithOptions(request: DescribeLogConfigRequest, runtime: Util.RuntimeOptions): DescribeLogConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.logType)) {
    query['LogType'] = request.logType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLogConfig',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeLogConfig(request: DescribeLogConfigRequest): DescribeLogConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLogConfigWithOptions(request, runtime);
}

model DescribePurchasedApiRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribePurchasedApiResponseBody = {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  bodyFormat?: string(name='BodyFormat'),
  createdTime?: string(name='CreatedTime'),
  description?: string(name='Description'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  httpMethod?: string(name='HttpMethod'),
  httpProtocol?: string(name='HttpProtocol'),
  mock?: string(name='Mock'),
  mockResult?: string(name='MockResult'),
  modifiedTime?: string(name='ModifiedTime'),
  path?: string(name='Path'),
  pathParameters?: {
    pathParameter?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
    }
  ](name='PathParameter')
  }(name='PathParameters'),
  postBodyDescription?: string(name='PostBodyDescription'),
  postBodyType?: string(name='PostBodyType'),
  regionId?: string(name='RegionId'),
  requestBody?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      docOrder?: string(name='DocOrder'),
      docShow?: string(name='DocShow'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: string(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: string(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
    }
  ](name='RequestParam')
  }(name='RequestBody'),
  requestHeaders?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      docOrder?: string(name='DocOrder'),
      docShow?: string(name='DocShow'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
    }
  ](name='RequestParam')
  }(name='RequestHeaders'),
  requestId?: string(name='RequestId'),
  requestQueries?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      docOrder?: string(name='DocOrder'),
      docShow?: string(name='DocShow'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: string(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: string(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
    }
  ](name='RequestParam')
  }(name='RequestQueries'),
  resultSample?: string(name='ResultSample'),
  resultType?: string(name='ResultType'),
  visibility?: string(name='Visibility'),
}

model DescribePurchasedApiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribePurchasedApiResponseBody(name='body'),
}

async function describePurchasedApiWithOptions(request: DescribePurchasedApiRequest, runtime: Util.RuntimeOptions): DescribePurchasedApiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePurchasedApi',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describePurchasedApi(request: DescribePurchasedApiRequest): DescribePurchasedApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePurchasedApiWithOptions(request, runtime);
}

model DescribePurchasedApiGroupDetailRequest {
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribePurchasedApiGroupDetailResponseBody = {
  createdTime?: string(name='CreatedTime'),
  description?: string(name='Description'),
  domainItems?: {
    domainItem?: [ 
    {
      domainName?: string(name='DomainName'),
    }
  ](name='DomainItem')
  }(name='DomainItems'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  modifiedTime?: string(name='ModifiedTime'),
  regionId?: string(name='RegionId'),
  requestId?: string(name='RequestId'),
  status?: string(name='Status'),
}

model DescribePurchasedApiGroupDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribePurchasedApiGroupDetailResponseBody(name='body'),
}

async function describePurchasedApiGroupDetailWithOptions(request: DescribePurchasedApiGroupDetailRequest, runtime: Util.RuntimeOptions): DescribePurchasedApiGroupDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePurchasedApiGroupDetail',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describePurchasedApiGroupDetail(request: DescribePurchasedApiGroupDetailRequest): DescribePurchasedApiGroupDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePurchasedApiGroupDetailWithOptions(request, runtime);
}

model DescribePurchasedApiGroupsRequest {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
}

model DescribePurchasedApiGroupsResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  purchasedApiGroupAttributes?: {
    purchasedApiGroupAttribute?: [ 
    {
      billingType?: string(name='BillingType'),
      createdTime?: string(name='CreatedTime'),
      expireTime?: string(name='ExpireTime'),
      groupDescription?: string(name='GroupDescription'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      invokeTimesMax?: long(name='InvokeTimesMax'),
      invokeTimesNow?: long(name='InvokeTimesNow'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
    }
  ](name='PurchasedApiGroupAttribute')
  }(name='PurchasedApiGroupAttributes'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribePurchasedApiGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribePurchasedApiGroupsResponseBody(name='body'),
}

async function describePurchasedApiGroupsWithOptions(request: DescribePurchasedApiGroupsRequest, runtime: Util.RuntimeOptions): DescribePurchasedApiGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePurchasedApiGroups',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describePurchasedApiGroups(request: DescribePurchasedApiGroupsRequest): DescribePurchasedApiGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePurchasedApiGroupsWithOptions(request, runtime);
}

model DescribePurchasedApisRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
}

model DescribePurchasedApisResponseBody = {
  apiInfos?: {
    apiInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      deployedTime?: string(name='DeployedTime'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
      stageName?: string(name='StageName'),
      visibility?: string(name='Visibility'),
    }
  ](name='ApiInfo')
  }(name='ApiInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribePurchasedApisResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribePurchasedApisResponseBody(name='body'),
}

async function describePurchasedApisWithOptions(request: DescribePurchasedApisRequest, runtime: Util.RuntimeOptions): DescribePurchasedApisResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePurchasedApis',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describePurchasedApis(request: DescribePurchasedApisRequest): DescribePurchasedApisResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePurchasedApisWithOptions(request, runtime);
}

model DescribeRaceWorkForInnerRequest {
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeRaceWorkForInnerResponseBody = {
  commodityCode?: string(name='CommodityCode'),
  createTime?: string(name='CreateTime'),
  groupId?: string(name='GroupId'),
  keywords?: string(name='Keywords'),
  logoUrl?: string(name='LogoUrl'),
  modifiedTime?: string(name='ModifiedTime'),
  requestId?: string(name='RequestId'),
  shortDescription?: string(name='ShortDescription'),
  workName?: string(name='WorkName'),
}

model DescribeRaceWorkForInnerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeRaceWorkForInnerResponseBody(name='body'),
}

async function describeRaceWorkForInnerWithOptions(request: DescribeRaceWorkForInnerRequest, runtime: Util.RuntimeOptions): DescribeRaceWorkForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRaceWorkForInner',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeRaceWorkForInner(request: DescribeRaceWorkForInnerRequest): DescribeRaceWorkForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRaceWorkForInnerWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  language?: string(name='Language'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeRegionsResponseBody = {
  regions?: {
    region?: [ 
    {
      localName?: string(name='LocalName'),
      regionEndpoint?: string(name='RegionEndpoint'),
      regionId?: string(name='RegionId'),
    }
  ](name='Region')
  }(name='Regions'),
  requestId?: string(name='RequestId'),
}

model DescribeRegionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeRegionsResponseBody(name='body'),
}

async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeRulesByApiRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeRulesByApiResponseBody = {
  requestId?: string(name='RequestId'),
  rules?: {
    rule?: [ 
    {
      createdTime?: int32(name='CreatedTime'),
      ruleId?: string(name='RuleId'),
      ruleName?: string(name='RuleName'),
      ruleType?: string(name='RuleType'),
    }
  ](name='Rule')
  }(name='Rules'),
}

model DescribeRulesByApiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeRulesByApiResponseBody(name='body'),
}

async function describeRulesByApiWithOptions(request: DescribeRulesByApiRequest, runtime: Util.RuntimeOptions): DescribeRulesByApiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRulesByApi',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeRulesByApi(request: DescribeRulesByApiRequest): DescribeRulesByApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRulesByApiWithOptions(request, runtime);
}

model DescribeSecretKeysRequest {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  secretKeyId?: string(name='SecretKeyId'),
  secretKeyName?: string(name='SecretKeyName'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeSecretKeysResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  secretKeys?: {
    secretKey?: [ 
    {
      createdTime?: string(name='CreatedTime'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
      secretKey?: string(name='SecretKey'),
      secretKeyId?: string(name='SecretKeyId'),
      secretKeyName?: string(name='SecretKeyName'),
      secretKeyValue?: string(name='SecretKeyValue'),
    }
  ](name='SecretKey')
  }(name='SecretKeys'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeSecretKeysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSecretKeysResponseBody(name='body'),
}

async function describeSecretKeysWithOptions(request: DescribeSecretKeysRequest, runtime: Util.RuntimeOptions): DescribeSecretKeysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.secretKeyId)) {
    query['SecretKeyId'] = request.secretKeyId;
  }
  if (!Util.isUnset(request.secretKeyName)) {
    query['SecretKeyName'] = request.secretKeyName;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSecretKeys',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSecretKeys(request: DescribeSecretKeysRequest): DescribeSecretKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSecretKeysWithOptions(request, runtime);
}

model DescribeSystemParametersRequest {
  securityToken?: string(name='SecurityToken'),
}

model DescribeSystemParametersResponseBody = {
  requestId?: string(name='RequestId'),
  systemParameters?: {
    systemParameter?: [ 
    {
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      paramName?: string(name='ParamName'),
      paramType?: string(name='ParamType'),
    }
  ](name='SystemParameter')
  }(name='SystemParameters'),
}

model DescribeSystemParametersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSystemParametersResponseBody(name='body'),
}

async function describeSystemParametersWithOptions(request: DescribeSystemParametersRequest, runtime: Util.RuntimeOptions): DescribeSystemParametersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSystemParameters',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSystemParameters(request: DescribeSystemParametersRequest): DescribeSystemParametersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSystemParametersWithOptions(request, runtime);
}

model DescribeSystemParamsRequest {
  securityToken?: string(name='SecurityToken'),
}

model DescribeSystemParamsResponseBody = {
  requestId?: string(name='RequestId'),
  systemParams?: {
    systemParam?: [ 
    {
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      paramName?: string(name='ParamName'),
      paramType?: string(name='ParamType'),
    }
  ](name='SystemParam')
  }(name='SystemParams'),
}

model DescribeSystemParamsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSystemParamsResponseBody(name='body'),
}

async function describeSystemParamsWithOptions(request: DescribeSystemParamsRequest, runtime: Util.RuntimeOptions): DescribeSystemParamsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSystemParams',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSystemParams(request: DescribeSystemParamsRequest): DescribeSystemParamsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSystemParamsWithOptions(request, runtime);
}

model DescribeTrafficControlsRequest {
  apiUid?: string(name='ApiUid'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
  trafficControlId?: string(name='TrafficControlId'),
  trafficControlName?: string(name='TrafficControlName'),
}

model DescribeTrafficControlsResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
  trafficControls?: {
    trafficControl?: [ 
    {
      apiDefault?: int32(name='ApiDefault'),
      appDefault?: int32(name='AppDefault'),
      createdTime?: string(name='CreatedTime'),
      description?: string(name='Description'),
      modifiedTime?: string(name='ModifiedTime'),
      specialPolicies?: {
        specialPolicy?: [ 
        {
          specialType?: string(name='SpecialType'),
          specials?: {
            special?: [ 
            {
              specialKey?: string(name='SpecialKey'),
              trafficValue?: int32(name='TrafficValue'),
            }
          ](name='Special')
          }(name='Specials'),
        }
      ](name='SpecialPolicy')
      }(name='SpecialPolicies'),
      trafficControlId?: string(name='TrafficControlId'),
      trafficControlName?: string(name='TrafficControlName'),
      trafficControlUnit?: string(name='TrafficControlUnit'),
      userDefault?: int32(name='UserDefault'),
    }
  ](name='TrafficControl')
  }(name='TrafficControls'),
}

model DescribeTrafficControlsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeTrafficControlsResponseBody(name='body'),
}

async function describeTrafficControlsWithOptions(request: DescribeTrafficControlsRequest, runtime: Util.RuntimeOptions): DescribeTrafficControlsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiUid)) {
    query['ApiUid'] = request.apiUid;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  if (!Util.isUnset(request.trafficControlId)) {
    query['TrafficControlId'] = request.trafficControlId;
  }
  if (!Util.isUnset(request.trafficControlName)) {
    query['TrafficControlName'] = request.trafficControlName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTrafficControls',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeTrafficControls(request: DescribeTrafficControlsRequest): DescribeTrafficControlsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTrafficControlsWithOptions(request, runtime);
}

model ExportSwaggerRequest {
  apiUid?: string(name='ApiUid'),
  dataFormat?: string(name='DataFormat'),
  securityToken?: string(name='SecurityToken'),
}

model ExportSwaggerResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
}

model ExportSwaggerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ExportSwaggerResponseBody(name='body'),
}

async function exportSwaggerWithOptions(request: ExportSwaggerRequest, runtime: Util.RuntimeOptions): ExportSwaggerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiUid)) {
    query['ApiUid'] = request.apiUid;
  }
  if (!Util.isUnset(request.dataFormat)) {
    query['DataFormat'] = request.dataFormat;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ExportSwagger',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function exportSwagger(request: ExportSwaggerRequest): ExportSwaggerResponse {
  var runtime = new Util.RuntimeOptions{};
  return exportSwaggerWithOptions(request, runtime);
}

model GetApiMethodsRequest {
  apiPath?: string(name='ApiPath'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model GetApiMethodsResponseBody = {
  methods?: [ string ](name='Methods'),
  requestId?: string(name='RequestId'),
}

model GetApiMethodsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetApiMethodsResponseBody(name='body'),
}

async function getApiMethodsWithOptions(request: GetApiMethodsRequest, runtime: Util.RuntimeOptions): GetApiMethodsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiPath)) {
    query['ApiPath'] = request.apiPath;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetApiMethods',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getApiMethods(request: GetApiMethodsRequest): GetApiMethodsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getApiMethodsWithOptions(request, runtime);
}

model GetCustomizedInfoRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageId?: string(name='StageId'),
  stageName?: string(name='StageName'),
}

model GetCustomizedInfoResponseBody = {
  requestId?: string(name='RequestId'),
  sdkDemos?: {
    sdkDemo?: [ 
    {
      callDemo?: string(name='CallDemo'),
      ideKey?: string(name='IdeKey'),
    }
  ](name='SdkDemo')
  }(name='SdkDemos'),
}

model GetCustomizedInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCustomizedInfoResponseBody(name='body'),
}

async function getCustomizedInfoWithOptions(request: GetCustomizedInfoRequest, runtime: Util.RuntimeOptions): GetCustomizedInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageId)) {
    query['StageId'] = request.stageId;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCustomizedInfo',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCustomizedInfo(request: GetCustomizedInfoRequest): GetCustomizedInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCustomizedInfoWithOptions(request, runtime);
}

model ImportSwaggerRequest {
  data?: string(name='Data'),
  dataFormat?: string(name='DataFormat'),
  dryRun?: boolean(name='DryRun'),
  groupId?: string(name='GroupId'),
  overwrite?: boolean(name='Overwrite'),
}

model ImportSwaggerResponseBody = {
  failed?: {
    apiImportSwaggerFailed?: [ 
    {
      errorMsg?: string(name='ErrorMsg'),
      httpMethod?: string(name='HttpMethod'),
      path?: string(name='Path'),
    }
  ](name='ApiImportSwaggerFailed')
  }(name='Failed'),
  modelFailed?: {
    apiImportModelFailed?: [ 
    {
      errorMsg?: string(name='ErrorMsg'),
      groupId?: string(name='GroupId'),
      modelName?: string(name='ModelName'),
    }
  ](name='ApiImportModelFailed')
  }(name='ModelFailed'),
  modelSuccess?: {
    apiImportModelSuccess?: [ 
    {
      groupId?: string(name='GroupId'),
      modelName?: string(name='ModelName'),
      modelOperation?: string(name='ModelOperation'),
      modelUid?: string(name='ModelUid'),
    }
  ](name='ApiImportModelSuccess')
  }(name='ModelSuccess'),
  requestId?: string(name='RequestId'),
  success?: {
    apiImportSwaggerSuccess?: [ 
    {
      apiOperation?: string(name='ApiOperation'),
      apiUid?: string(name='ApiUid'),
      httpMethod?: string(name='HttpMethod'),
      path?: string(name='Path'),
    }
  ](name='ApiImportSwaggerSuccess')
  }(name='Success'),
}

model ImportSwaggerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ImportSwaggerResponseBody(name='body'),
}

async function importSwaggerWithOptions(request: ImportSwaggerRequest, runtime: Util.RuntimeOptions): ImportSwaggerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dataFormat)) {
    query['DataFormat'] = request.dataFormat;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.overwrite)) {
    query['Overwrite'] = request.overwrite;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.data)) {
    body['Data'] = request.data;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ImportSwagger',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function importSwagger(request: ImportSwaggerRequest): ImportSwaggerResponse {
  var runtime = new Util.RuntimeOptions{};
  return importSwaggerWithOptions(request, runtime);
}

model ModifyApiRequest {
  allowSignatureMethod?: string(name='AllowSignatureMethod'),
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  appCodeAuthType?: string(name='AppCodeAuthType'),
  authType?: string(name='AuthType'),
  description?: string(name='Description'),
  disableInternet?: boolean(name='DisableInternet'),
  errorCodeSamples?: string(name='ErrorCodeSamples'),
  failResultSample?: string(name='FailResultSample'),
  forceNonceCheck?: boolean(name='ForceNonceCheck'),
  groupId?: string(name='GroupId'),
  openIdConnectConfig?: string(name='OpenIdConnectConfig'),
  requestConfig?: string(name='RequestConfig'),
  requestParamters?: string(name='RequestParamters'),
  resultBodyModel?: string(name='ResultBodyModel'),
  resultDescriptions?: string(name='ResultDescriptions'),
  resultSample?: string(name='ResultSample'),
  resultType?: string(name='ResultType'),
  securityToken?: string(name='SecurityToken'),
  serviceConfig?: string(name='ServiceConfig'),
  serviceParameters?: string(name='ServiceParameters'),
  serviceParametersMap?: string(name='ServiceParametersMap'),
  visibility?: string(name='Visibility'),
  webSocketApiType?: string(name='WebSocketApiType'),
}

model ModifyApiResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyApiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyApiResponseBody(name='body'),
}

async function modifyApiWithOptions(request: ModifyApiRequest, runtime: Util.RuntimeOptions): ModifyApiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.allowSignatureMethod)) {
    query['AllowSignatureMethod'] = request.allowSignatureMethod;
  }
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.appCodeAuthType)) {
    query['AppCodeAuthType'] = request.appCodeAuthType;
  }
  if (!Util.isUnset(request.authType)) {
    query['AuthType'] = request.authType;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.disableInternet)) {
    query['DisableInternet'] = request.disableInternet;
  }
  if (!Util.isUnset(request.errorCodeSamples)) {
    query['ErrorCodeSamples'] = request.errorCodeSamples;
  }
  if (!Util.isUnset(request.failResultSample)) {
    query['FailResultSample'] = request.failResultSample;
  }
  if (!Util.isUnset(request.forceNonceCheck)) {
    query['ForceNonceCheck'] = request.forceNonceCheck;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.openIdConnectConfig)) {
    query['OpenIdConnectConfig'] = request.openIdConnectConfig;
  }
  if (!Util.isUnset(request.requestConfig)) {
    query['RequestConfig'] = request.requestConfig;
  }
  if (!Util.isUnset(request.requestParamters)) {
    query['RequestParamters'] = request.requestParamters;
  }
  if (!Util.isUnset(request.resultBodyModel)) {
    query['ResultBodyModel'] = request.resultBodyModel;
  }
  if (!Util.isUnset(request.resultDescriptions)) {
    query['ResultDescriptions'] = request.resultDescriptions;
  }
  if (!Util.isUnset(request.resultSample)) {
    query['ResultSample'] = request.resultSample;
  }
  if (!Util.isUnset(request.resultType)) {
    query['ResultType'] = request.resultType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serviceConfig)) {
    query['ServiceConfig'] = request.serviceConfig;
  }
  if (!Util.isUnset(request.serviceParameters)) {
    query['ServiceParameters'] = request.serviceParameters;
  }
  if (!Util.isUnset(request.serviceParametersMap)) {
    query['ServiceParametersMap'] = request.serviceParametersMap;
  }
  if (!Util.isUnset(request.visibility)) {
    query['Visibility'] = request.visibility;
  }
  if (!Util.isUnset(request.webSocketApiType)) {
    query['WebSocketApiType'] = request.webSocketApiType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyApi',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyApi(request: ModifyApiRequest): ModifyApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyApiWithOptions(request, runtime);
}

model ModifyApiGroupRequest {
  compatibleFlags?: string(name='CompatibleFlags'),
  customTraceConfig?: string(name='CustomTraceConfig'),
  defaultDomain?: string(name='DefaultDomain'),
  description?: string(name='Description'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  passthroughHeaders?: string(name='PassthroughHeaders'),
  rpcPattern?: string(name='RpcPattern'),
  securityToken?: string(name='SecurityToken'),
  userLogConfig?: string(name='UserLogConfig'),
}

model ModifyApiGroupResponseBody = {
  description?: string(name='Description'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  requestId?: string(name='RequestId'),
  subDomain?: string(name='SubDomain'),
}

model ModifyApiGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyApiGroupResponseBody(name='body'),
}

async function modifyApiGroupWithOptions(request: ModifyApiGroupRequest, runtime: Util.RuntimeOptions): ModifyApiGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.compatibleFlags)) {
    query['CompatibleFlags'] = request.compatibleFlags;
  }
  if (!Util.isUnset(request.customTraceConfig)) {
    query['CustomTraceConfig'] = request.customTraceConfig;
  }
  if (!Util.isUnset(request.defaultDomain)) {
    query['DefaultDomain'] = request.defaultDomain;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.passthroughHeaders)) {
    query['PassthroughHeaders'] = request.passthroughHeaders;
  }
  if (!Util.isUnset(request.rpcPattern)) {
    query['RpcPattern'] = request.rpcPattern;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.userLogConfig)) {
    query['UserLogConfig'] = request.userLogConfig;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyApiGroup',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyApiGroup(request: ModifyApiGroupRequest): ModifyApiGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyApiGroupWithOptions(request, runtime);
}

model ModifyAppRequest {
  appId?: long(name='AppId'),
  appName?: string(name='AppName'),
  description?: string(name='Description'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyAppResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyAppResponseBody(name='body'),
}

async function modifyAppWithOptions(request: ModifyAppRequest, runtime: Util.RuntimeOptions): ModifyAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyApp',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyApp(request: ModifyAppRequest): ModifyAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAppWithOptions(request, runtime);
}

model ModifyInstanceAttributeRequest {
  httpsPolicy?: string(name='HttpsPolicy'),
  instanceId?: string(name='InstanceId'),
  instanceName?: string(name='InstanceName'),
  token?: string(name='Token'),
}

model ModifyInstanceAttributeResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyInstanceAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyInstanceAttributeResponseBody(name='body'),
}

async function modifyInstanceAttributeWithOptions(request: ModifyInstanceAttributeRequest, runtime: Util.RuntimeOptions): ModifyInstanceAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.httpsPolicy)) {
    query['HttpsPolicy'] = request.httpsPolicy;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceAttribute',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyInstanceAttribute(request: ModifyInstanceAttributeRequest): ModifyInstanceAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyInstanceAttributeWithOptions(request, runtime);
}

model ModifyInstanceVpcAttributeRequest {
  instanceId?: string(name='InstanceId'),
  token?: string(name='Token'),
  vpcId?: string(name='VpcId'),
}

model ModifyInstanceVpcAttributeResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyInstanceVpcAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyInstanceVpcAttributeResponseBody(name='body'),
}

async function modifyInstanceVpcAttributeWithOptions(request: ModifyInstanceVpcAttributeRequest, runtime: Util.RuntimeOptions): ModifyInstanceVpcAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceVpcAttribute',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyInstanceVpcAttribute(request: ModifyInstanceVpcAttributeRequest): ModifyInstanceVpcAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyInstanceVpcAttributeWithOptions(request, runtime);
}

model ModifyIpControlRequest {
  description?: string(name='Description'),
  ipControlId?: string(name='IpControlId'),
  ipControlName?: string(name='IpControlName'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyIpControlResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyIpControlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyIpControlResponseBody(name='body'),
}

async function modifyIpControlWithOptions(request: ModifyIpControlRequest, runtime: Util.RuntimeOptions): ModifyIpControlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.ipControlId)) {
    query['IpControlId'] = request.ipControlId;
  }
  if (!Util.isUnset(request.ipControlName)) {
    query['IpControlName'] = request.ipControlName;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyIpControl',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyIpControl(request: ModifyIpControlRequest): ModifyIpControlResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyIpControlWithOptions(request, runtime);
}

model ModifyIpControlPolicyItemRequest {
  appId?: string(name='AppId'),
  cidrIp?: string(name='CidrIp'),
  ipControlId?: string(name='IpControlId'),
  policyItemId?: string(name='PolicyItemId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyIpControlPolicyItemResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyIpControlPolicyItemResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyIpControlPolicyItemResponseBody(name='body'),
}

async function modifyIpControlPolicyItemWithOptions(request: ModifyIpControlPolicyItemRequest, runtime: Util.RuntimeOptions): ModifyIpControlPolicyItemResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.cidrIp)) {
    query['CidrIp'] = request.cidrIp;
  }
  if (!Util.isUnset(request.ipControlId)) {
    query['IpControlId'] = request.ipControlId;
  }
  if (!Util.isUnset(request.policyItemId)) {
    query['PolicyItemId'] = request.policyItemId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyIpControlPolicyItem',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyIpControlPolicyItem(request: ModifyIpControlPolicyItemRequest): ModifyIpControlPolicyItemResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyIpControlPolicyItemWithOptions(request, runtime);
}

model ModifyLogConfigRequest {
  logType?: string(name='LogType'),
  securityToken?: string(name='SecurityToken'),
  slsLogStore?: string(name='SlsLogStore'),
  slsProject?: string(name='SlsProject'),
}

model ModifyLogConfigResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyLogConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyLogConfigResponseBody(name='body'),
}

async function modifyLogConfigWithOptions(request: ModifyLogConfigRequest, runtime: Util.RuntimeOptions): ModifyLogConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.logType)) {
    query['LogType'] = request.logType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.slsLogStore)) {
    query['SlsLogStore'] = request.slsLogStore;
  }
  if (!Util.isUnset(request.slsProject)) {
    query['SlsProject'] = request.slsProject;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyLogConfig',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyLogConfig(request: ModifyLogConfigRequest): ModifyLogConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyLogConfigWithOptions(request, runtime);
}

model ModifySecretKeyRequest {
  secretKey?: string(name='SecretKey'),
  secretKeyId?: string(name='SecretKeyId'),
  secretKeyName?: string(name='SecretKeyName'),
  secretValue?: string(name='SecretValue'),
  securityToken?: string(name='SecurityToken'),
}

model ModifySecretKeyResponseBody = {
  requestId?: string(name='RequestId'),
  secretKeyId?: string(name='SecretKeyId'),
  secretKeyName?: string(name='SecretKeyName'),
}

model ModifySecretKeyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySecretKeyResponseBody(name='body'),
}

async function modifySecretKeyWithOptions(request: ModifySecretKeyRequest, runtime: Util.RuntimeOptions): ModifySecretKeyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.secretKey)) {
    query['SecretKey'] = request.secretKey;
  }
  if (!Util.isUnset(request.secretKeyId)) {
    query['SecretKeyId'] = request.secretKeyId;
  }
  if (!Util.isUnset(request.secretKeyName)) {
    query['SecretKeyName'] = request.secretKeyName;
  }
  if (!Util.isUnset(request.secretValue)) {
    query['SecretValue'] = request.secretValue;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySecretKey',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySecretKey(request: ModifySecretKeyRequest): ModifySecretKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySecretKeyWithOptions(request, runtime);
}

model ModifyTrafficControlRequest {
  apiDefault?: int32(name='ApiDefault'),
  appDefault?: int32(name='AppDefault'),
  description?: string(name='Description'),
  securityToken?: string(name='SecurityToken'),
  trafficControlId?: string(name='TrafficControlId'),
  trafficControlName?: string(name='TrafficControlName'),
  trafficControlUnit?: string(name='TrafficControlUnit'),
  userDefault?: int32(name='UserDefault'),
}

model ModifyTrafficControlResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyTrafficControlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyTrafficControlResponseBody(name='body'),
}

async function modifyTrafficControlWithOptions(request: ModifyTrafficControlRequest, runtime: Util.RuntimeOptions): ModifyTrafficControlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiDefault)) {
    query['ApiDefault'] = request.apiDefault;
  }
  if (!Util.isUnset(request.appDefault)) {
    query['AppDefault'] = request.appDefault;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.trafficControlId)) {
    query['TrafficControlId'] = request.trafficControlId;
  }
  if (!Util.isUnset(request.trafficControlName)) {
    query['TrafficControlName'] = request.trafficControlName;
  }
  if (!Util.isUnset(request.trafficControlUnit)) {
    query['TrafficControlUnit'] = request.trafficControlUnit;
  }
  if (!Util.isUnset(request.userDefault)) {
    query['UserDefault'] = request.userDefault;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTrafficControl',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyTrafficControl(request: ModifyTrafficControlRequest): ModifyTrafficControlResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTrafficControlWithOptions(request, runtime);
}

model ReactivateDomainRequest {
  domainName?: string(name='DomainName'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model ReactivateDomainResponseBody = {
  requestId?: string(name='RequestId'),
}

model ReactivateDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ReactivateDomainResponseBody(name='body'),
}

async function reactivateDomainWithOptions(request: ReactivateDomainRequest, runtime: Util.RuntimeOptions): ReactivateDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReactivateDomain',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function reactivateDomain(request: ReactivateDomainRequest): ReactivateDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return reactivateDomainWithOptions(request, runtime);
}

model RecoverApiFromHistoricalRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  historyVersion?: string(name='HistoryVersion'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model RecoverApiFromHistoricalResponseBody = {
  requestId?: string(name='RequestId'),
}

model RecoverApiFromHistoricalResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RecoverApiFromHistoricalResponseBody(name='body'),
}

async function recoverApiFromHistoricalWithOptions(request: RecoverApiFromHistoricalRequest, runtime: Util.RuntimeOptions): RecoverApiFromHistoricalResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.historyVersion)) {
    query['HistoryVersion'] = request.historyVersion;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RecoverApiFromHistorical',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function recoverApiFromHistorical(request: RecoverApiFromHistoricalRequest): RecoverApiFromHistoricalResponse {
  var runtime = new Util.RuntimeOptions{};
  return recoverApiFromHistoricalWithOptions(request, runtime);
}

model RecoveryApiDefineFromHistoricalRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  historyVersion?: string(name='HistoryVersion'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model RecoveryApiDefineFromHistoricalResponseBody = {
  requestId?: string(name='RequestId'),
}

model RecoveryApiDefineFromHistoricalResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RecoveryApiDefineFromHistoricalResponseBody(name='body'),
}

async function recoveryApiDefineFromHistoricalWithOptions(request: RecoveryApiDefineFromHistoricalRequest, runtime: Util.RuntimeOptions): RecoveryApiDefineFromHistoricalResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.historyVersion)) {
    query['HistoryVersion'] = request.historyVersion;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RecoveryApiDefineFromHistorical',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function recoveryApiDefineFromHistorical(request: RecoveryApiDefineFromHistoricalRequest): RecoveryApiDefineFromHistoricalResponse {
  var runtime = new Util.RuntimeOptions{};
  return recoveryApiDefineFromHistoricalWithOptions(request, runtime);
}

model RecoveryApiFromHistoricalRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  historyVersion?: string(name='HistoryVersion'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model RecoveryApiFromHistoricalResponseBody = {
  requestId?: string(name='RequestId'),
}

model RecoveryApiFromHistoricalResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RecoveryApiFromHistoricalResponseBody(name='body'),
}

async function recoveryApiFromHistoricalWithOptions(request: RecoveryApiFromHistoricalRequest, runtime: Util.RuntimeOptions): RecoveryApiFromHistoricalResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.historyVersion)) {
    query['HistoryVersion'] = request.historyVersion;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RecoveryApiFromHistorical',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function recoveryApiFromHistorical(request: RecoveryApiFromHistoricalRequest): RecoveryApiFromHistoricalResponse {
  var runtime = new Util.RuntimeOptions{};
  return recoveryApiFromHistoricalWithOptions(request, runtime);
}

model RefreshDomainRequest {
  domainName?: string(name='DomainName'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model RefreshDomainResponseBody = {
  certificateId?: string(name='CertificateId'),
  certificateName?: string(name='CertificateName'),
  domainName?: string(name='DomainName'),
  domainNameResolution?: string(name='DomainNameResolution'),
  domainStatus?: string(name='DomainStatus'),
  groupId?: string(name='GroupId'),
  requestId?: string(name='RequestId'),
  subDomain?: string(name='SubDomain'),
}

model RefreshDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RefreshDomainResponseBody(name='body'),
}

async function refreshDomainWithOptions(request: RefreshDomainRequest, runtime: Util.RuntimeOptions): RefreshDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RefreshDomain',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function refreshDomain(request: RefreshDomainRequest): RefreshDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return refreshDomainWithOptions(request, runtime);
}

model RemoveAccessPermissionByApisRequest {
  apiIds?: string(name='ApiIds'),
  appId?: long(name='AppId'),
  description?: string(name='Description'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model RemoveAccessPermissionByApisResponseBody = {
  requestId?: string(name='RequestId'),
}

model RemoveAccessPermissionByApisResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveAccessPermissionByApisResponseBody(name='body'),
}

async function removeAccessPermissionByApisWithOptions(request: RemoveAccessPermissionByApisRequest, runtime: Util.RuntimeOptions): RemoveAccessPermissionByApisResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiIds)) {
    query['ApiIds'] = request.apiIds;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveAccessPermissionByApis',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeAccessPermissionByApis(request: RemoveAccessPermissionByApisRequest): RemoveAccessPermissionByApisResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeAccessPermissionByApisWithOptions(request, runtime);
}

model RemoveAccessPermissionByAppsRequest {
  apiId?: string(name='ApiId'),
  appIds?: string(name='AppIds'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model RemoveAccessPermissionByAppsResponseBody = {
  requestId?: string(name='RequestId'),
}

model RemoveAccessPermissionByAppsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveAccessPermissionByAppsResponseBody(name='body'),
}

async function removeAccessPermissionByAppsWithOptions(request: RemoveAccessPermissionByAppsRequest, runtime: Util.RuntimeOptions): RemoveAccessPermissionByAppsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.appIds)) {
    query['AppIds'] = request.appIds;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveAccessPermissionByApps',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeAccessPermissionByApps(request: RemoveAccessPermissionByAppsRequest): RemoveAccessPermissionByAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeAccessPermissionByAppsWithOptions(request, runtime);
}

model RemoveAllBlackListRequest {
  blackType?: string(name='BlackType'),
  securityToken?: string(name='SecurityToken'),
}

model RemoveAllBlackListResponseBody = {
  requestId?: string(name='RequestId'),
}

model RemoveAllBlackListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveAllBlackListResponseBody(name='body'),
}

async function removeAllBlackListWithOptions(request: RemoveAllBlackListRequest, runtime: Util.RuntimeOptions): RemoveAllBlackListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.blackType)) {
    query['BlackType'] = request.blackType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveAllBlackList',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeAllBlackList(request: RemoveAllBlackListRequest): RemoveAllBlackListResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeAllBlackListWithOptions(request, runtime);
}

model RemoveApiRuleRequest {
  apiIds?: string(name='ApiIds'),
  groupId?: string(name='GroupId'),
  ruleId?: string(name='RuleId'),
  ruleType?: string(name='RuleType'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model RemoveApiRuleResponseBody = {
  requestId?: string(name='RequestId'),
}

model RemoveApiRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveApiRuleResponseBody(name='body'),
}

async function removeApiRuleWithOptions(request: RemoveApiRuleRequest, runtime: Util.RuntimeOptions): RemoveApiRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiIds)) {
    query['ApiIds'] = request.apiIds;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.ruleType)) {
    query['RuleType'] = request.ruleType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveApiRule',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeApiRule(request: RemoveApiRuleRequest): RemoveApiRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeApiRuleWithOptions(request, runtime);
}

model RemoveBlackListRequest {
  blackContent?: string(name='BlackContent'),
  blackType?: string(name='BlackType'),
  securityToken?: string(name='SecurityToken'),
}

model RemoveBlackListResponseBody = {
  requestId?: string(name='RequestId'),
}

model RemoveBlackListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveBlackListResponseBody(name='body'),
}

async function removeBlackListWithOptions(request: RemoveBlackListRequest, runtime: Util.RuntimeOptions): RemoveBlackListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.blackContent)) {
    query['BlackContent'] = request.blackContent;
  }
  if (!Util.isUnset(request.blackType)) {
    query['BlackType'] = request.blackType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveBlackList',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeBlackList(request: RemoveBlackListRequest): RemoveBlackListResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeBlackListWithOptions(request, runtime);
}

model RemoveIpControlApisRequest {
  apiIds?: string(name='ApiIds'),
  groupId?: string(name='GroupId'),
  ipControlId?: string(name='IpControlId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model RemoveIpControlApisResponseBody = {
  requestId?: string(name='RequestId'),
}

model RemoveIpControlApisResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveIpControlApisResponseBody(name='body'),
}

async function removeIpControlApisWithOptions(request: RemoveIpControlApisRequest, runtime: Util.RuntimeOptions): RemoveIpControlApisResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiIds)) {
    query['ApiIds'] = request.apiIds;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.ipControlId)) {
    query['IpControlId'] = request.ipControlId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveIpControlApis',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeIpControlApis(request: RemoveIpControlApisRequest): RemoveIpControlApisResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeIpControlApisWithOptions(request, runtime);
}

model RemoveIpControlPolicyItemRequest {
  ipControlId?: string(name='IpControlId'),
  policyItemIds?: string(name='PolicyItemIds'),
  securityToken?: string(name='SecurityToken'),
}

model RemoveIpControlPolicyItemResponseBody = {
  requestId?: string(name='RequestId'),
}

model RemoveIpControlPolicyItemResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveIpControlPolicyItemResponseBody(name='body'),
}

async function removeIpControlPolicyItemWithOptions(request: RemoveIpControlPolicyItemRequest, runtime: Util.RuntimeOptions): RemoveIpControlPolicyItemResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipControlId)) {
    query['IpControlId'] = request.ipControlId;
  }
  if (!Util.isUnset(request.policyItemIds)) {
    query['PolicyItemIds'] = request.policyItemIds;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveIpControlPolicyItem',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeIpControlPolicyItem(request: RemoveIpControlPolicyItemRequest): RemoveIpControlPolicyItemResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeIpControlPolicyItemWithOptions(request, runtime);
}

model ResetAppKeySecretRequest {
  appKey?: string(name='AppKey'),
  securityToken?: string(name='SecurityToken'),
}

model ResetAppKeySecretResponseBody = {
  requestId?: string(name='RequestId'),
}

model ResetAppKeySecretResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResetAppKeySecretResponseBody(name='body'),
}

async function resetAppKeySecretWithOptions(request: ResetAppKeySecretRequest, runtime: Util.RuntimeOptions): ResetAppKeySecretResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResetAppKeySecret',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resetAppKeySecret(request: ResetAppKeySecretRequest): ResetAppKeySecretResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetAppKeySecretWithOptions(request, runtime);
}

model ResetCustomizedRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageId?: string(name='StageId'),
  stageName?: string(name='StageName'),
}

model ResetCustomizedResponseBody = {
  requestId?: string(name='RequestId'),
  sdkDemos?: {
    sdkDemo?: [ 
    {
      callDemo?: string(name='CallDemo'),
      ideKey?: string(name='IdeKey'),
    }
  ](name='SdkDemo')
  }(name='SdkDemos'),
}

model ResetCustomizedResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResetCustomizedResponseBody(name='body'),
}

async function resetCustomizedWithOptions(request: ResetCustomizedRequest, runtime: Util.RuntimeOptions): ResetCustomizedResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageId)) {
    query['StageId'] = request.stageId;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResetCustomized',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resetCustomized(request: ResetCustomizedRequest): ResetCustomizedResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetCustomizedWithOptions(request, runtime);
}

model SdkGenerateRequest {
  appId?: long(name='AppId'),
  groupId?: string(name='GroupId'),
  language?: string(name='Language'),
  securityToken?: string(name='SecurityToken'),
}

model SdkGenerateResponseBody = {
  downloadLink?: string(name='DownloadLink'),
  requestId?: string(name='RequestId'),
}

model SdkGenerateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SdkGenerateResponseBody(name='body'),
}

async function sdkGenerateWithOptions(request: SdkGenerateRequest, runtime: Util.RuntimeOptions): SdkGenerateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SdkGenerate',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sdkGenerate(request: SdkGenerateRequest): SdkGenerateResponse {
  var runtime = new Util.RuntimeOptions{};
  return sdkGenerateWithOptions(request, runtime);
}

model SdkGenerateByAppRequest {
  appId?: long(name='AppId'),
  language?: string(name='Language'),
  securityToken?: string(name='SecurityToken'),
}

model SdkGenerateByAppResponseBody = {
  downloadLink?: string(name='DownloadLink'),
  requestId?: string(name='RequestId'),
}

model SdkGenerateByAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SdkGenerateByAppResponseBody(name='body'),
}

async function sdkGenerateByAppWithOptions(request: SdkGenerateByAppRequest, runtime: Util.RuntimeOptions): SdkGenerateByAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SdkGenerateByApp',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sdkGenerateByApp(request: SdkGenerateByAppRequest): SdkGenerateByAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return sdkGenerateByAppWithOptions(request, runtime);
}

model SdkGenerateByGroupRequest {
  groupId?: string(name='GroupId'),
  language?: string(name='Language'),
  securityToken?: string(name='SecurityToken'),
}

model SdkGenerateByGroupResponseBody = {
  downloadLink?: string(name='DownloadLink'),
  requestId?: string(name='RequestId'),
}

model SdkGenerateByGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SdkGenerateByGroupResponseBody(name='body'),
}

async function sdkGenerateByGroupWithOptions(request: SdkGenerateByGroupRequest, runtime: Util.RuntimeOptions): SdkGenerateByGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SdkGenerateByGroup',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sdkGenerateByGroup(request: SdkGenerateByGroupRequest): SdkGenerateByGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return sdkGenerateByGroupWithOptions(request, runtime);
}

model SetAccessPermissionByApisRequest {
  apiIds?: string(name='ApiIds'),
  appId?: long(name='AppId'),
  authValidTime?: string(name='AuthValidTime'),
  description?: string(name='Description'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model SetAccessPermissionByApisResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetAccessPermissionByApisResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetAccessPermissionByApisResponseBody(name='body'),
}

async function setAccessPermissionByApisWithOptions(request: SetAccessPermissionByApisRequest, runtime: Util.RuntimeOptions): SetAccessPermissionByApisResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiIds)) {
    query['ApiIds'] = request.apiIds;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.authValidTime)) {
    query['AuthValidTime'] = request.authValidTime;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetAccessPermissionByApis',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setAccessPermissionByApis(request: SetAccessPermissionByApisRequest): SetAccessPermissionByApisResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAccessPermissionByApisWithOptions(request, runtime);
}

model SetAccessPermissionsRequest {
  apiId?: string(name='ApiId'),
  appIds?: string(name='AppIds'),
  description?: string(name='Description'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model SetAccessPermissionsResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetAccessPermissionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetAccessPermissionsResponseBody(name='body'),
}

async function setAccessPermissionsWithOptions(request: SetAccessPermissionsRequest, runtime: Util.RuntimeOptions): SetAccessPermissionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.appIds)) {
    query['AppIds'] = request.appIds;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetAccessPermissions',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setAccessPermissions(request: SetAccessPermissionsRequest): SetAccessPermissionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAccessPermissionsWithOptions(request, runtime);
}

model SetApiRuleRequest {
  apiIds?: string(name='ApiIds'),
  groupId?: string(name='GroupId'),
  ruleId?: string(name='RuleId'),
  ruleType?: string(name='RuleType'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model SetApiRuleResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetApiRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetApiRuleResponseBody(name='body'),
}

async function setApiRuleWithOptions(request: SetApiRuleRequest, runtime: Util.RuntimeOptions): SetApiRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiIds)) {
    query['ApiIds'] = request.apiIds;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.ruleType)) {
    query['RuleType'] = request.ruleType;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetApiRule',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setApiRule(request: SetApiRuleRequest): SetApiRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return setApiRuleWithOptions(request, runtime);
}

model SetDomainRequest {
  bindStageName?: string(name='BindStageName'),
  certificateBody?: string(name='CertificateBody'),
  certificateName?: string(name='CertificateName'),
  domainName?: string(name='DomainName'),
  groupId?: string(name='GroupId'),
  isForce?: boolean(name='IsForce'),
  privateKey?: string(name='PrivateKey'),
  securityToken?: string(name='SecurityToken'),
}

model SetDomainResponseBody = {
  domainBindingStatus?: string(name='DomainBindingStatus'),
  domainLegalStatus?: string(name='DomainLegalStatus'),
  domainName?: string(name='DomainName'),
  domainRemark?: string(name='DomainRemark'),
  domainWebSocketStatus?: string(name='DomainWebSocketStatus'),
  groupId?: string(name='GroupId'),
  requestId?: string(name='RequestId'),
  subDomain?: string(name='SubDomain'),
}

model SetDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetDomainResponseBody(name='body'),
}

async function setDomainWithOptions(request: SetDomainRequest, runtime: Util.RuntimeOptions): SetDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bindStageName)) {
    query['BindStageName'] = request.bindStageName;
  }
  if (!Util.isUnset(request.certificateBody)) {
    query['CertificateBody'] = request.certificateBody;
  }
  if (!Util.isUnset(request.certificateName)) {
    query['CertificateName'] = request.certificateName;
  }
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.isForce)) {
    query['IsForce'] = request.isForce;
  }
  if (!Util.isUnset(request.privateKey)) {
    query['PrivateKey'] = request.privateKey;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetDomain',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setDomain(request: SetDomainRequest): SetDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return setDomainWithOptions(request, runtime);
}

model SetDomainCertificateRequest {
  caCertificateBody?: string(name='CaCertificateBody'),
  certificateBody?: string(name='CertificateBody'),
  certificateName?: string(name='CertificateName'),
  domainName?: string(name='DomainName'),
  groupId?: string(name='GroupId'),
  privateKey?: string(name='PrivateKey'),
  securityToken?: string(name='SecurityToken'),
}

model SetDomainCertificateResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetDomainCertificateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetDomainCertificateResponseBody(name='body'),
}

async function setDomainCertificateWithOptions(request: SetDomainCertificateRequest, runtime: Util.RuntimeOptions): SetDomainCertificateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.caCertificateBody)) {
    query['CaCertificateBody'] = request.caCertificateBody;
  }
  if (!Util.isUnset(request.certificateBody)) {
    query['CertificateBody'] = request.certificateBody;
  }
  if (!Util.isUnset(request.certificateName)) {
    query['CertificateName'] = request.certificateName;
  }
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.privateKey)) {
    query['PrivateKey'] = request.privateKey;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetDomainCertificate',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setDomainCertificate(request: SetDomainCertificateRequest): SetDomainCertificateResponse {
  var runtime = new Util.RuntimeOptions{};
  return setDomainCertificateWithOptions(request, runtime);
}

model SetDomainWebSocketStatusRequest {
  actionValue?: string(name='ActionValue'),
  domainName?: string(name='DomainName'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model SetDomainWebSocketStatusResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetDomainWebSocketStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetDomainWebSocketStatusResponseBody(name='body'),
}

async function setDomainWebSocketStatusWithOptions(request: SetDomainWebSocketStatusRequest, runtime: Util.RuntimeOptions): SetDomainWebSocketStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.actionValue)) {
    query['ActionValue'] = request.actionValue;
  }
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetDomainWebSocketStatus',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setDomainWebSocketStatus(request: SetDomainWebSocketStatusRequest): SetDomainWebSocketStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return setDomainWebSocketStatusWithOptions(request, runtime);
}

model SetIpControlApisRequest {
  apiIds?: string(name='ApiIds'),
  groupId?: string(name='GroupId'),
  ipControlId?: string(name='IpControlId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model SetIpControlApisResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetIpControlApisResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetIpControlApisResponseBody(name='body'),
}

async function setIpControlApisWithOptions(request: SetIpControlApisRequest, runtime: Util.RuntimeOptions): SetIpControlApisResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiIds)) {
    query['ApiIds'] = request.apiIds;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.ipControlId)) {
    query['IpControlId'] = request.ipControlId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetIpControlApis',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setIpControlApis(request: SetIpControlApisRequest): SetIpControlApisResponse {
  var runtime = new Util.RuntimeOptions{};
  return setIpControlApisWithOptions(request, runtime);
}

model SetMockIntegrationRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  mock?: string(name='Mock'),
  mockResult?: string(name='MockResult'),
  securityToken?: string(name='SecurityToken'),
}

model SetMockIntegrationResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetMockIntegrationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetMockIntegrationResponseBody(name='body'),
}

async function setMockIntegrationWithOptions(request: SetMockIntegrationRequest, runtime: Util.RuntimeOptions): SetMockIntegrationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.mock)) {
    query['Mock'] = request.mock;
  }
  if (!Util.isUnset(request.mockResult)) {
    query['MockResult'] = request.mockResult;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetMockIntegration',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setMockIntegration(request: SetMockIntegrationRequest): SetMockIntegrationResponse {
  var runtime = new Util.RuntimeOptions{};
  return setMockIntegrationWithOptions(request, runtime);
}

model SetWildcardDomainPatternsRequest {
  domainName?: string(name='DomainName'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  wildcardDomainPatterns?: string(name='WildcardDomainPatterns'),
}

model SetWildcardDomainPatternsResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetWildcardDomainPatternsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetWildcardDomainPatternsResponseBody(name='body'),
}

async function setWildcardDomainPatternsWithOptions(request: SetWildcardDomainPatternsRequest, runtime: Util.RuntimeOptions): SetWildcardDomainPatternsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.wildcardDomainPatterns)) {
    query['WildcardDomainPatterns'] = request.wildcardDomainPatterns;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetWildcardDomainPatterns',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setWildcardDomainPatterns(request: SetWildcardDomainPatternsRequest): SetWildcardDomainPatternsResponse {
  var runtime = new Util.RuntimeOptions{};
  return setWildcardDomainPatternsWithOptions(request, runtime);
}

model SwitchApiRequest {
  apiId?: string(name='ApiId'),
  description?: string(name='Description'),
  groupId?: string(name='GroupId'),
  historyVersion?: string(name='HistoryVersion'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model SwitchApiResponseBody = {
  requestId?: string(name='RequestId'),
}

model SwitchApiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SwitchApiResponseBody(name='body'),
}

async function switchApiWithOptions(request: SwitchApiRequest, runtime: Util.RuntimeOptions): SwitchApiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.historyVersion)) {
    query['HistoryVersion'] = request.historyVersion;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SwitchApi',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function switchApi(request: SwitchApiRequest): SwitchApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return switchApiWithOptions(request, runtime);
}

model VpcDescribeAccessesRequest {
  instanceId?: string(name='InstanceId'),
  instancePort?: string(name='InstancePort'),
  name?: string(name='Name'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  vpcId?: string(name='VpcId'),
}

model VpcDescribeAccessesResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
  vpcAccessAttributes?: {
    vpcAccessAttribute?: [ 
    {
      createdTime?: string(name='CreatedTime'),
      id?: string(name='Id'),
      instanceId?: string(name='InstanceId'),
      modifiedTime?: string(name='ModifiedTime'),
      name?: string(name='Name'),
      port?: string(name='Port'),
      regionId?: string(name='RegionId'),
      status?: string(name='Status'),
      userId?: string(name='UserId'),
      vpcId?: string(name='VpcId'),
    }
  ](name='VpcAccessAttribute')
  }(name='VpcAccessAttributes'),
}

model VpcDescribeAccessesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: VpcDescribeAccessesResponseBody(name='body'),
}

async function vpcDescribeAccessesWithOptions(request: VpcDescribeAccessesRequest, runtime: Util.RuntimeOptions): VpcDescribeAccessesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instancePort)) {
    query['InstancePort'] = request.instancePort;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VpcDescribeAccesses',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function vpcDescribeAccesses(request: VpcDescribeAccessesRequest): VpcDescribeAccessesResponse {
  var runtime = new Util.RuntimeOptions{};
  return vpcDescribeAccessesWithOptions(request, runtime);
}

model VpcGrantAccessRequest {
  instanceId?: string(name='InstanceId'),
  instancePort?: string(name='InstancePort'),
  name?: string(name='Name'),
  securityToken?: string(name='SecurityToken'),
  token?: string(name='Token'),
  vpcId?: string(name='VpcId'),
}

model VpcGrantAccessResponseBody = {
  requestId?: string(name='RequestId'),
}

model VpcGrantAccessResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: VpcGrantAccessResponseBody(name='body'),
}

async function vpcGrantAccessWithOptions(request: VpcGrantAccessRequest, runtime: Util.RuntimeOptions): VpcGrantAccessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instancePort)) {
    query['InstancePort'] = request.instancePort;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VpcGrantAccess',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function vpcGrantAccess(request: VpcGrantAccessRequest): VpcGrantAccessResponse {
  var runtime = new Util.RuntimeOptions{};
  return vpcGrantAccessWithOptions(request, runtime);
}

model VpcModifyAccessRequest {
  instanceId?: string(name='InstanceId'),
  instancePort?: string(name='InstancePort'),
  securityToken?: string(name='SecurityToken'),
  token?: string(name='Token'),
  vpcId?: string(name='VpcId'),
}

model VpcModifyAccessResponseBody = {
  requestId?: string(name='RequestId'),
}

model VpcModifyAccessResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: VpcModifyAccessResponseBody(name='body'),
}

async function vpcModifyAccessWithOptions(request: VpcModifyAccessRequest, runtime: Util.RuntimeOptions): VpcModifyAccessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instancePort)) {
    query['InstancePort'] = request.instancePort;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VpcModifyAccess',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function vpcModifyAccess(request: VpcModifyAccessRequest): VpcModifyAccessResponse {
  var runtime = new Util.RuntimeOptions{};
  return vpcModifyAccessWithOptions(request, runtime);
}

model VpcRevokeAccessRequest {
  instanceId?: string(name='InstanceId'),
  instancePort?: string(name='InstancePort'),
  securityToken?: string(name='SecurityToken'),
  token?: string(name='Token'),
  vpcId?: string(name='VpcId'),
}

model VpcRevokeAccessResponseBody = {
  requestId?: string(name='RequestId'),
}

model VpcRevokeAccessResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: VpcRevokeAccessResponseBody(name='body'),
}

async function vpcRevokeAccessWithOptions(request: VpcRevokeAccessRequest, runtime: Util.RuntimeOptions): VpcRevokeAccessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instancePort)) {
    query['InstancePort'] = request.instancePort;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VpcRevokeAccess',
    version = '2016-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function vpcRevokeAccess(request: VpcRevokeAccessRequest): VpcRevokeAccessResponse {
  var runtime = new Util.RuntimeOptions{};
  return vpcRevokeAccessWithOptions(request, runtime);
}

